综合开发

JPGEncoder does not redefine the image as movieclip in as3

微信扫一扫,分享到朋友圈

JPGEncoder does not redefine the image as movieclip in as3

I am trying to create a image using JPGEncoder class
JPG Encoder

original size of mainclip is 540 X 180 i tried to increase size of image in same ratio but getting half filled image with blank white part.

mainclip.width=1080;
mainclip.height=360;
var myBitmapData:BitmapData = new BitmapData(mainclip.width,mainclip.height);
myBitmapData.draw(mainclip);
var jpgEncoder:JPGEncoder = new JPGEncoder(100);
var imgByteData:ByteArray = jpgEncoder.encode(myBitmapData);
fileRef.save(imgByteData, "test.jpg");

You should initially increase size of your clip by using .scaleX and .scaleY

mainclip.scaleX = mainclip.scaleY = 2;

By changing width and height you just increase your clip container boundaries

And I’d suggest using this lib instead, it’s faster.

Dashmap: Blazing fast concurrent HashMap for Rust

上一篇

Combine + Diffable Data Source

下一篇

你也可能喜欢

评论已经被关闭。

插入图片

热门栏目

JPGEncoder does not redefine the image as movieclip in as3

长按储存图像,分享给朋友