简体   繁体   English

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

[英]Flex BitmapData or ImageSnapshot for uninitialized components

I would like to make some kind of thumbnail with capturing BitmapData or ImageSnapshot of some UNINITIALIZED components in my Flex application. 我想通过捕获Flex应用程序中一些未初始化组件的BitmapDataImageSnapshot来制作某种缩略图。
Is it possible? 可能吗?

Thanks in advance! 提前致谢!
m.

No. I believe you will end up getting null references if the components are not initialized (The graphics and stuff will all be uninitialized). 否。我相信,如果未初始化组件,则最终将获得null引用(图形和内容将全部未初始化)。 You can simply initialize the components but make them hidden and take a thumbnail. 您可以简单地初始化组件,但将其隐藏并拍摄缩略图。

@CookieOfFortune Thanks for help man =) @CookieOfFortune感谢您的帮助人=)
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. _32是我要提取缩略图的组件。 tempHolder is Canvas , testImg is Image class. tempHolderCanvastestImgImage类。 tempHolder displays what I want to capture, while testImg in my case is always white... tempHolder显示我要捕获的内容,而在我的情况下, testImg始终为白色...
I don't understand it =) 我不明白=)

Thanks one more time ;-) 多谢一次;-)

@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. @Jasconius我使用了您描述的技术来将导入的东西的缩略图创建到AIR应用程序中,这是构建所有例程的一个障碍,但是最后我对这种解决方案感到满意。 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. 这样做的好处是,在构建thumbnailcreatorComponent时,可以将其放置在应用的视图区域中以查看发生了什么。 Later, when you are sure that everything works fine, you can put the thumbnailCreator at -10000,-10000 and forget about it. 稍后,当您确定一切正常时,可以将thumbnailCreator放在-10000,-10000并忽略它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM