所有标签:

Flex3 控件转图片

AS3, Flex/Flash, Flex3 无评论 »

var sceneHolder:UIComponent  = new UIComponent();
this.addChildAt(sceneHolder, 0);
var snapShotBMD:BitmapData=ImageSnapshot.captureBitmapData(myLabel);
var myBitmap:Bitmap = new Bitmap(snapShotBMD);

sceneHolder.addChild(myBitmap);

Tags »|

ImageSnapshot-Flex3自带截图功能

Flex3 无评论 »

mx.graphics.ImageSnapshot是Flex3自带的截图组件,默认保存图片格式为PNG,支持格式为PNG和JPG.
使用方法:
ImageSnapshot.captureBitmapData(v);得到v的BitmapData
ImageSnapshot.encodeImageAsBase64(ImageSnapshot.captureImage(v));得到v的Base64 String

Tags »