微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Silverlight - WriteableBitmap的跨域调用限制

Silverlight 3中增加WriteableBitmap 大大方便了图片编辑。最近使用了.NET Image Tools,其中很多编辑功能都是基于对WritableBitmap的操作。项目中有一个Image的Source是来自不同域下的Uri,使用.NET Image Tools是遇到了一个异常"Cannnot acess Bitmap",搜索一个讨论,才发现WriteableBitmap也有跨域调用下的限制:

 

The WriteableBitmap class has a security model that restricts access to the Pixels array,if the WriteableBitmap is constructed using cross-domain content. For example,a WriteableBitmap that is constructed using a BitmapImage referencing a URL that comes from another domain does not permit access to its Pixels array. The restriction extends to any UI element that uses a URL-derived property for setting some or all of its content. In particular,this restriction applies to the "Grab a frame of a running video from MediaElement" scenario. If the MediaElement.source references a video file from another domain,the WriteableBitmap created by referencing the MediaElement as the element source restricts access to the Pixels array.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐