开发者

How to use the method setPixels(rectangle, byteArray) of bitmapData in Adobe Flex

Error #2030: End of file was encountered.

This method is not working

I am using it like thi开发者_如何学运维s

var ba:ByteArray = new ByteArray();
ba = bmd.getPixels(bmd.rect);

bmd.setPixels(srcRect, ba);
bm.bitmapData = bmd;

img.source = bm;


You need to reset the possition of your Byte Array (ba.position = 0) before re-using it

var ba:ByteArray = new ByteArray();
ba = bmd.getPixels(bmd.rect);

ba.position = 0;
bmd.setPixels(srcRect, ba);
bm.bitmapData = bmd;

img.source = bm;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜