How to export image from swf with ActionScript3/PHP?

后端 未结 2 1594
我寻月下人不归
我寻月下人不归 2021-01-15 20:10

i have another piece for more advanced guys than me ;)

I am developing a simple flash application to create your own coat of arms. When finished creating, it would b

2条回答
  •  太阳男子
    2021-01-15 20:34

    First, draw the image (Sprite or MovieClip, etc) into a BitmapData:

    var b: BitmapData = new BitmapData(640, 480, false, 0xffffffff); 
    b.draw(mcToBeSaved);
    

    Then, use e.g. as3corelib to encode the BitmapData into PNG or JPG files.

    var ba: ByteArray = PNGEncoder.encode(b);
    

    Then, for Flash 10, you can immediately get the user to save the image to a file, using FileReference's save method.

提交回复
热议问题