개정판 4ca11b36
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