在 Flex 中将 ImageSnapshot 转换为图像 [英] Turning an ImageSnapshot into an Image in Flex

查看:30
本文介绍了在 Flex 中将 ImageSnapshot 转换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Flex 3,我想拍摄这样的图像快照:

Using Flex 3, I would like to take an image snapshot such as this:

var logoSnapshot:ImageSnapshot = ImageSnapshot.captureImage(logoContainer);

并把它变成 Image 类可以使用的东西.我看到有一个名为data"的属性,它包含一个 byteArray,所以我想我的问题是:如何获取存储为 byteArray 的图像并将其转换为 Image 类可以用来显示的内容?

and turn it into something that the Image class can use. I see that there is a property called "data", that holds a byteArray, so I guess my question is: How do I take an image that gets stored as a byteArray and convert it to something the Image class can use to display?

推荐答案

应该有效的更简单的实现:

Simpler implementation that should work:

var bm : Bitmap = new Bitmap(ImageSnapshot.captureBitmapData(logoContainer));

将bm"设置为 Image 对象的来源.

Set "bm" as the source of your Image object.

这篇关于在 Flex 中将 ImageSnapshot 转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆