개정판 adce8360
issue #932: Sync 페이지가 제대로 로딩되지 않는 부분 개선
Change-Id: Idc3764695ed1183f350e8f0358a5c36b6e0fac78
KCOM/Common/ImageSourceHelper.cs | ||
---|---|---|
55 | 55 |
} |
56 | 56 |
} |
57 | 57 |
|
58 |
public static BitmapImage GetDownloadImage(string uri) |
|
59 |
{ |
|
60 |
return GetDownloadImage(new Uri(uri)); |
|
61 |
} |
|
62 |
|
|
63 |
public static BitmapImage GetDownloadImage(Uri uri) |
|
64 |
{ |
|
65 |
BitmapImage resultImage = new BitmapImage(); |
|
66 |
|
|
67 |
resultImage.BeginInit(); |
|
68 |
resultImage.CacheOption = BitmapCacheOption.OnLoad; |
|
69 |
resultImage.UriCachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.Default); |
|
70 |
resultImage.UriSource = uri; |
|
71 |
resultImage.EndInit(); |
|
72 |
|
|
73 |
resultImage.DownloadProgress += (ex, arg) => |
|
74 |
{ |
|
75 |
System.Diagnostics.Debug.WriteLine($"download Image : {arg.Progress}%"); |
|
76 |
}; |
|
77 |
|
|
78 |
while (resultImage.IsDownloading) |
|
79 |
{ |
|
80 |
System.Windows.Forms.Application.DoEvents(); //Method from thread linked above |
|
81 |
System.Diagnostics.Debug.WriteLine("doEvent"); |
|
82 |
} |
|
83 |
|
|
84 |
resultImage.Freeze(); |
|
85 |
return resultImage; |
|
86 |
} |
|
87 |
|
|
58 | 88 |
public static byte[] CopyPixels(BitmapSource image) |
59 | 89 |
{ |
60 | 90 |
byte[] result = new byte[image.PixelWidth * image.PixelHeight * 4]; |
내보내기 Unified diff