프로젝트

일반

사용자정보

개정판 4ca11b36

ID4ca11b36d8f667bbf8715adfd40ddf5fff49c4a8
상위 2b19f5f2
하위 9fa712a5, 6707a5c7

김동진이(가) 약 6년 전에 추가함

issue #000 Tempload image gc add

차이점 보기:

KCOM/Views/MainMenu.xaml.cs
421 421
                uri = String.Format(Properties.Settings.Default.subServerImageWebPath, _ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, PageNumber);
422 422
            }
423 423

  
424
            var defaultBitmapImage = new BitmapImage(new Uri(uri));
424
            var defaultBitmapImage = new BitmapImage();
425
            defaultBitmapImage.BeginInit();
426
            defaultBitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
427
            defaultBitmapImage.CacheOption = BitmapCacheOption.OnLoad;
428
            defaultBitmapImage.UriSource = new Uri(uri);
429
            defaultBitmapImage.EndInit();
425 430

  
426
            ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
427
            ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth;
428
            ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight;
431
            ViewerDataModel.Instance.ImageViewPath = null;
432
            GC.Collect();
429 433

  
430 434
            if (defaultBitmapImage.IsDownloading)
431 435
            {
432 436
                defaultBitmapImage.DownloadCompleted += (ex, arg) =>
433 437
                {
438
                    defaultBitmapImage.Freeze();
439
                    mainPanel.UpdateLayout();
440
                    GC.Collect();
434 441
                    ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
435 442
                    ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth;
436 443
                    ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight;
......
719 726
            defaultBitmapImage.EndInit();
720 727

  
721 728
            ViewerDataModel.Instance.ImageViewPath = null;
722
            GC.Collect();
723
            ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
724
            ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth;
725
            ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight;
729
            GC.Collect();            
726 730

  
727 731
            if (defaultBitmapImage.IsDownloading)
728 732
            {
......
730 734
                {
731 735
                    defaultBitmapImage.Freeze();
732 736
                    mainPanel.UpdateLayout();
733
                    GC.Collect();
734
                    //System.Diagnostics.Debug.WriteLine("image changed");
737
                    GC.Collect();                    
735 738
                    ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
736 739
                    ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth;
737 740
                    ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight;

내보내기 Unified diff

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