Flex 3.4 - imageSnapshot 问题,链接图像~

发布于 2024-08-07 06:55:40 字数 654 浏览 1 评论 0原文

经过早些时候的一些可爱的帮助,我几乎完成了我正在做的项目。我以为我已经完成了,但我却遇到了最后一个问题。我的程序对文件的最终输出进行了屏幕截图,并且文件的最终输出包含一些来自其中 URL 的链接图像。现在,当图像被排除时,它保存得很好,但是当我从网址加载图像时,它似乎不允许我的 imageSnapShot 工作。

private function takeSnapshot(even:Event=null):void {

    var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(previewMode);
    var MyFile:FileReference = new FileReference();

    MyFile.save(imageSnap.data, 'profile.png');


 }

其中“previewMode”是组件,我正在获取(视图堆栈)的屏幕转储,里面有一些来自网站的链接图像。

通过一些测试,它似乎停止了 -

var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(previewMode);

所以它实际上并没有获得输出的图像。任何帮助将不胜感激,到目前为止你们都很棒。

After some lovely help here earlier Ive almost finished the project Im working on. I thought i had it completed but Ive gone and ran into one final issue. My program takes a screenshot of the final output of my file, and the final output of my file has some linked images from URLs inside of it. Now when the images are excluded, it saves just fine, but when i load in an image from a web address it doesnt seem to allow my imageSnapShot to work.

private function takeSnapshot(even:Event=null):void {

    var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(previewMode);
    var MyFile:FileReference = new FileReference();

    MyFile.save(imageSnap.data, 'profile.png');


 }

Where "previewMode" is the component Im taking a screendump of (a viewstack) and inside there are some linked images from websites.

Through some testing it seems to stop on -

var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(previewMode);

So it isnt actually getting the image of the output. Any help would be greatly apperciated, you have all been wonderful so far.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

逐鹿 2024-08-14 06:55:40

ImageSnapshot.captureImage 可能正在使用 BitmapData.draw() 方法来拍摄快照。此方法的 livedocs 页面说:

源对象及其(对于 Sprite 或 MovieClip 对象)所有子对象必须来自与调用者相同的域,或者必须位于调用者可以通过调用Security.allowDomain() 方法。如果不满足这些条件,draw() 方法不会绘制任何内容。

您的文件中有一些来自 URL 的链接图像。显然这是不允许的。请查看 Security.allowDomain一个可能的解决方法。如果您有外部图像这些规则也适用。

如果从用于加载图像的 Loader 对象域以外的域加载 Bitmap 对象,并且没有允许访问 Loader 对象域的跨域策略文件,则该脚本中的脚本域无法访问 Bitmap 对象或其属性和方法。

ImageSnapshot.captureImage might be using the BitmapData.draw() method to take the snap shot. The livedocs page on this method says that:

The source object and (in the case of a Sprite or MovieClip object) all of its child objects must come from the same domain as the caller, or must be in a SWF file that is accessible to the caller by having called the Security.allowDomain() method. If these conditions are not met, the draw() method does not draw anything.

Your file has some linked images from URLs inside it. Apparently that's not allowed. Check out Security.allowDomain for a possible work around. If you have external images these rules also apply.

If you load a Bitmap object from a domain other than that of the Loader object used to load the image, and there is no cross-domain policy file that permits access to the domain of the Loader object, then a script in that domain cannot access the Bitmap object or its properties and methods.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文