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.
以上是内存溢出为你收集整理的Silverlight - WriteableBitmap的跨域调用限制全部内容,希望文章能够帮你解决Silverlight - WriteableBitmap的跨域调用限制所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)