프로젝트

일반

사용자정보

개정판 a860bafc

IDa860bafc057611814a09fb5898d619fb81e89017
상위 0c575433
하위 079a438a

김태성이(가) 4달 전에 추가함

issue #0000 compare 기능 수정

Change-Id: Idbac07b170a08bc67f50d315912f314da1ef8938

차이점 보기:

KCOM/Views/MainMenu.xaml.cs
5371 5371
        /// <summary>
5372 5372
        /// 문서 Comprare
5373 5373
        /// </summary>
5374
        private void SetCompareRect()
5374
        private async void SetCompareRect()
5375 5375
        {
5376 5376
            canvas_compareBorder.Children.Clear();
5377 5377

  
5378 5378
            if (CompareMode.IsChecked)
5379 5379
            {
5380
                //borderComprareWait.Visibility = Visibility.Visible;
5381

  
5380 5382
                if (ViewerDataModel.Instance.PageBalanceMode && ViewerDataModel.Instance.PageBalanceNumber == 0)
5381 5383
                {
5382 5384
                    ViewerDataModel.Instance.PageBalanceNumber = 1;
......
5388 5390

  
5389 5391
                //Logger.sendReqLog("GetCompareRectsTargetSizeAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID + "," + CurrentRev.DOCUMENT_ID +"," + pageNavigator.CurrentPage.PageNumber.ToString() + "," + ViewerDataModel.Instance.PageNumber.ToString() + "," + userData.COMPANY != "EXT" ? "true" : "false", 1);
5390 5392

  
5391
                bool isTargetSize = false;
5393
                /// 비교대상원본, 비교할 대상
5394
                //BaseClient.GetCompareRectsTargetSizeAsync(_ViewInfo.ProjectNO, _ViewInfo.DocumentItemID,  CurrentRev.DOCUMENT_ID,  ViewerDataModel.Instance.SyncPageNumber.ToString(), pageNavigator.CurrentPage.PageNumber.ToString(), isTargetSize, userData.COMPANY != "EXT" ? "true" : "false");
5392 5395

  
5393
                if(OriginalSizeMode.IsChecked)
5396
                using (Markus.Image.ImageCompare imageCompare = new Markus.Image.ImageCompare())
5394 5397
                {
5395
                    isTargetSize = true;
5396
                }
5398
                    //imageCompare.Progress.PropertyChanged += (snd, evt) =>
5399
                    //{
5400
                    //    progressCompare.Dispatcher.InvokeAsync(() =>
5401
                    //    {
5402
                    //        progressCompare.Value = imageCompare.Progress.Percentage;
5403
                    //    });
5404
                    //};
5397 5405

  
5398
                /// 비교대상원본, 비교할 대상
5399
                BaseClient.GetCompareRectsTargetSizeAsync(_ViewInfo.ProjectNO, _ViewInfo.DocumentItemID,  CurrentRev.DOCUMENT_ID,  ViewerDataModel.Instance.SyncPageNumber.ToString(), pageNavigator.CurrentPage.PageNumber.ToString(), isTargetSize, userData.COMPANY != "EXT" ? "true" : "false");
5406
                    System.Drawing.Size imageSize = new System.Drawing.Size((int)ViewerDataModel.Instance.ImageViewWidth_C, (int)ViewerDataModel.Instance.ImageViewHeight_C);
5407

  
5408
                    var result = await imageCompare.CompareReturnRectsAsync(ViewerDataModel.Instance.ImageViewPath, ViewerDataModel.Instance.ImageViewPath_C, new System.Drawing.Size(10, 10), imageSize);
5409
                    
5410
                    //borderComprareWait.Visibility = Visibility.Collapsed;
5411

  
5412
                    CompareDisplay(result);
5413
                }
5400 5414
            }
5401 5415
            else
5402 5416
            {
......
5405 5419
            }
5406 5420
        }
5407 5421

  
5422
        private void CompareDisplay(List<Rect> rects)
5423
        {
5424
            rects.ForEach(d =>
5425
            {
5426
                d.Inflate(new Size(10, 10));
5427

  
5428
                var point = MarkupToPDF.Controls.Common.MathSet.getRectMiddlePoint(d);
5429
                System.Windows.Shapes.Rectangle myEllipse = new System.Windows.Shapes.Rectangle();
5430
                myEllipse.Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(150, 33, 215, 119));
5431
                myEllipse.Opacity = 1;
5432
                //myEllipse.Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Green);
5433
                //myEllipse.StrokeThickness = 2;
5434
                myEllipse.Width = d.Width;
5435
                myEllipse.Height = d.Height;
5436
                Canvas.SetLeft(myEllipse, d.X - ((point.X - d.X) / 2.0));
5437
                Canvas.SetTop(myEllipse, d.Y - ((point.Y - d.Y) / 2.0));
5438
                myEllipse.RenderTransformOrigin = point;
5439
                canvas_compareBorder.Children.Add(myEllipse);
5440
            });
5441

  
5442
            canvas_compareBorder.Visibility = Visibility.Visible;
5443
            da.From = 1;
5444
            da.To = 0.5;
5445
            da.Duration = new Duration(TimeSpan.FromSeconds(1));
5446
            da.AutoReverse = true;
5447
            canvas_compareBorder.BeginAnimation(OpacityProperty, da);
5448
        }
5449

  
5408 5450
        private void btnSync_Click(object sender, RoutedEventArgs e)
5409 5451
        {
5410 5452
            gridViewHistory_Busy.IsBusy = true;
......
5488 5530
            string uri = this.GetImageURL(CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.SyncPageNumber);
5489 5531
            var isOriginalSize = !(ViewerDataModel.Instance.SyncPageNumber == pageNavigator.CurrentPage.PageNumber);
5490 5532

  
5533
            canvas_compareBorder.Visibility = Visibility.Hidden;
5534
            ClearCompareRect();
5535

  
5491 5536
            ComparePageLoad(uri, OriginalSizeMode.IsChecked);
5492 5537
        }
5493 5538

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)