actionscript 3 - Scaling AVM1Movie for using with BitmapData in as3 -


i have actionscript 2 swf wanting export png, fact loaded avm1movie in as3 proving quite troublesome.

when load as2 swf in normal standalone flash player, can right click -> zoom in , scales since redrawing vector data @ size. when i'm trying make loader object (that contains loaded as2 swf) scale, whenever draw bitmapdata object, original size of swf blank space around it, rather having swf scale new dimensions.

my code looks this:

var thefile:file = file(event.target);  var dis:displayobject = this.mloader.content; dis.width *=2; dis.height *=2;  var bd:bitmapdata = new bitmapdata(dis.width, dis.height, true, 0x00000000); trace("display object height , width " + dis.width + " " + dis.height); bd.draw(dis);  var stream:filestream = new filestream(); stream.open(thefile, filemode.write); stream.writebytes(pngencoder.encode(bd)); // needs as3corelib stream.close();  alert.show("saved " + thefile.nativepath ); 

but when open resulting png file, (red shows transparent background):

resulting image

is there way make when draw as2 swf bitmapdata, scales in flash player?

i believe should able use scalex , scaley properties instead of attempting multiple height , width values.

var dis:displayobject = this.mloader.content; //dis.width *=2; dis.scalex = 2; //dis.height *=2; dis.scaley = 2; 

edit alternatively since above isn't working try use matrix argument draw call.

var mat:matrix = new matrix(); mat.scale(2,2); bd.draw(dis,mat); 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -