개정판 eb9a8cb6
이미지 로딩 수정
Change-Id: I1a9cb2c7132db145d555268c101b7f1bf6169612
KCOM/Controls/DecodeImage.cs | ||
---|---|---|
26 | 26 |
|
27 | 27 |
|
28 | 28 |
public static readonly DependencyProperty ViewSourceProperty = DependencyProperty.Register( |
29 |
"ViewSource", typeof(BitmapImage), typeof(ScaleDecodeImage));
|
|
29 |
"ViewSource", typeof(ImageSource), typeof(ScaleDecodeImage));
|
|
30 | 30 |
|
31 | 31 |
|
32 |
public BitmapImage ViewSource
|
|
32 |
public ImageSource ViewSource
|
|
33 | 33 |
{ |
34 |
get => (BitmapImage)GetValue(ViewSourceProperty);
|
|
34 |
get => (ImageSource)GetValue(ViewSourceProperty);
|
|
35 | 35 |
set => SetValue(ViewSourceProperty, value); |
36 | 36 |
} |
37 | 37 |
|
... | ... | |
76 | 76 |
if (owner != null) |
77 | 77 |
{ |
78 | 78 |
var value = owner.Scale; |
79 |
System.Windows.Media.Imaging.BitmapImage image = owner.Source.Clone(); |
|
79 |
//System.Windows.Media.Imaging.BitmapImage image = owner.Source.Clone();
|
|
80 | 80 |
|
81 |
image.DecodePixelWidth = (int)(image.PixelWidth * value); |
|
82 |
image.DecodePixelHeight = (int)(image.PixelHeight * value); |
|
81 |
//image.DecodePixelWidth = (int)(image.PixelWidth * value);
|
|
82 |
//image.DecodePixelHeight = (int)(image.PixelHeight * value);
|
|
83 | 83 |
|
84 |
owner.ViewSource = image; |
|
84 |
//owner.ViewSource = image; |
|
85 |
|
|
86 |
if (value < 1) |
|
87 |
{ |
|
88 |
TransformedBitmap tb = new TransformedBitmap(); |
|
89 |
tb.BeginInit(); |
|
90 |
tb.Source = owner.Source; |
|
91 |
tb.Transform = new ScaleTransform(value, value); |
|
92 |
tb.EndInit(); |
|
93 |
System.Diagnostics.Debug.WriteLine($"TranFormImage Height : {tb.Height} Scale : {value}"); |
|
94 |
owner.ViewSource = tb; |
|
95 |
} |
|
85 | 96 |
} |
86 | 97 |
} |
87 | 98 |
} |
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
5267 | 5267 |
/// <returns></returns> |
5268 | 5268 |
private void ScaleImage(double pageWidth,double pageHeight) |
5269 | 5269 |
{ |
5270 |
mainPanel.Scale = (zoomAndPanControl.ContentScale >= 0.1) ? 1 : zoomAndPanControl.ContentScale; |
|
5270 |
mainPanel.Scale = zoomAndPanControl.ContentScale;// (zoomAndPanControl.ContentScale >= 0.1) ? 1 : zoomAndPanControl.ContentScale;
|
|
5271 | 5271 |
} |
5272 | 5272 |
|
5273 | 5273 |
private void thumbnailPanel_SizeChanged(object sender, SizeChangedEventArgs e) |
내보내기 Unified diff