积极答复者
关于 Image.Source 的问题

问题
答案
-
bi3.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
加上这个
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
- 已建议为答案 Sheldon _XiaoModerator 2012年2月7日 4:02
- 已标记为答案 Jie BaoModerator 2012年2月10日 2:35
全部回复
-
string imgPath = Environment.CurrentDirectory + "\\zp.bmp"; if (File.Exists(imgPath)) { BitmapImage bi3 = new BitmapImage(); bi3.BeginInit(); bi3.CacheOption = BitmapCacheOption.OnLoad; bi3.UriSource = new Uri(imgPath, UriKind.Absolute); bi3.EndInit(); bi3.Freeze(); Image.Source = bi3; }
第一次运行时很好,第二次读时,还是第一次读的那个图片,真是邪门了。
- 已编辑 等风的落叶 2012年2月3日 11:42
-
bi3.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
加上这个
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
- 已建议为答案 Sheldon _XiaoModerator 2012年2月7日 4:02
- 已标记为答案 Jie BaoModerator 2012年2月10日 2:35
-
加上bi3.EndInit(); 你的代码可以正常工作
Sheldon _Xiao[MSFT]
MSDN Community Support | Feedback to us
Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
没看到 sorry
Sheldon _Xiao[MSFT]
MSDN Community Support | Feedback to us
Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.