用于未初始化组件的 Flex BitmapData 或 ImageSnapshot

发布于 2024-08-08 05:39:57 字数 127 浏览 1 评论 0原文

我想通过捕获 Flex 应用程序中某些未初始化组件的 BitmapDataImageSnapshot 来制作某种缩略图。
是否可以?

预先感谢!
米。

I would like to make some kind of thumbnail with capturing BitmapData or ImageSnapshot of some UNINITIALIZED components in my Flex application.
Is it possible?

Thanks in advance!
m.

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

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

发布评论

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

评论(3

蒲公英的约定 2024-08-15 05:39:58

不,我相信如果组件未初始化,您最终会得到空引用(图形和其他内容都将未初始化)。您可以简单地初始化组件,但将它们隐藏并获取缩略图。

No. I believe you will end up getting null references if the components are not initialized (The graphics and stuff will all be uninitialized). You can simply initialize the components but make them hidden and take a thumbnail.

又怨 2024-08-15 05:39:58

@CookieOfFortune
感谢您的帮助,伙计=)
我尝试在我的主应用程序中制作类似的东西

private function createThumbs():void{

    thumbsData = new ArrayCollection();

    tempHolder.addChild(_32);

    var bm:BitmapData = getBitmapData(tempHolder);
    var img:Image = new Image();
    img.source = new Bitmap(bm);
    thumbsData.addItem(img);

    tempHolder.visible = false;

    testImg.source = new Bitmap(bm);
}

_32 是我想要获取缩略图的组件。 tempHolderCanvastestImgImage 类。
tempHolder 显示我想要捕获的内容,而 testImg 在我的情况下始终是白色...
我不明白 =)

再次感谢;-)

@CookieOfFortune
Thanks for help man =)
I tried to make something like this in my main application

private function createThumbs():void{

    thumbsData = new ArrayCollection();

    tempHolder.addChild(_32);

    var bm:BitmapData = getBitmapData(tempHolder);
    var img:Image = new Image();
    img.source = new Bitmap(bm);
    thumbsData.addItem(img);

    tempHolder.visible = false;

    testImg.source = new Bitmap(bm);
}

_32 is my component which I would like to take thumbnail. tempHolder is Canvas, testImg is Image class.
tempHolder displays what I want to capture, while testImg in my case is always white...
I don't understand it =)

Thanks one more time ;-)

风柔一江水 2024-08-15 05:39:58

@Jasconius,我使用了您描述的技术来创建导入内容的缩略图到 AIR 应用程序中,构建所有例程很麻烦,但最终我对这个解决方案感到满意。我用它来从图像、视频和模块创建缩略图(每个都有不同的容器和加载和卸载素材的例程),

这样做的好处是,当您构建缩略图创建器组件时 - 您可以将其放置在应用程序来查看发生了什么。稍后,当您确定一切正常时,您可以将缩略图创建器设置为-10000、-10000,然后忘记它。

@Jasconius I used the technique you describe for creating thumbnails of imported stuff into an AIR app and it's a drag to build all the routines, but in the end I'm satisfied with this solution. I use it for creating thumbnails from images, video and modules (with each a different container and routines to load and unload the footage)

The good part of this is that when you are building your thumbnailcreatorComponent - you can position it in the viewarea of the app to see what's going on. Later, when you are sure that everything works fine, you can put the thumbnailCreator at -10000,-10000 and forget about it.

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