在WP7中显示图像控件的加载进度
加载图像时如何获取加载进度以及加载百分比信息?
我有这个:
Image image = new Image();
image.Source = new BitmapImage(new Uri("http://somesite.com/someimage.jpg"));
我期望这样的事情:
image.Loading += RoutedEventHandler(image_Loading);
但我找不到任何这样的事件。有 Loaded (与加载源无关)和 ImageOpened (在加载源完成并影响布局过程后触发)。
我知道这是可能的,因为我看到其他应用程序指示图像的加载进度(例如“img 新闻阅读器”)。使用标准图像控件可以实现这一点吗?是否有提供此功能的第三方控件,或者我必须编写自己的控件吗?
How do I get loading progress with the percent loaded info when an image is loading?
I have this:
Image image = new Image();
image.Source = new BitmapImage(new Uri("http://somesite.com/someimage.jpg"));
I expected something like this:
image.Loading += RoutedEventHandler(image_Loading);
but I can't find any such event. There is Loaded (not related to loading the source) and ImageOpened (which fires after loading the source is complete and has effected a layout pass).
I know it is possible because I have seen other apps indicate loading progress for images (for example "img news reader"). Is this possible with the standard Image Control, is there a 3rd party control that provides this, or do I have to write my own?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DownloadProgress 是我正在寻找的事件,它隐藏在 BitmapImage 类中:
DownloadProgress is the event I was looking for, and it was hiding in the BitmapImage class: