Date: 六月 30th, 2009
Cate: Flex/AS3/Flash, Mate, PHP
Tags: , ,  

Take a snapshot of Flex app,anyplace,anysize!

Once upon a time.I found in flex we can use ImageSnapShot to snapshot some pictures from a flex component container.(reference:Taking a snapshot of Flex app, from Flex!)but as much as ever? fixed component size, fixed component position?
And now.I had seen somewhere is possible.It could locate how extractly it was to be done.very easy to do such a screen capture / screen grab using Flex in flashplayer.

The essential steps are:
* Create a new BitmapData object(Application.application.stage).
* Copy the target component's(here is ResizeableTitleWindow.snappedArea(Canvas)) pixel data into BitmapData object.
* Convert the BitmapData object to a PNG encoded ByteArray (using the PNGEnc library)
* Convert the ByteArray to a Base64Encoded string so that we can send the data safely to the backend.
* On the backend (PHP(RAW_DATA)), decode the data and write it to a file.
ps:via PopUp ResizeableTitleWindow to move SnapshotComponent to anywhere,to zoom anysize;using Degrafa RasterTextPlug to rotate (not embed fonts) TextField;

here is the demo:(Flex+Mate Framework+UndoRedoFramework+Degrafa via simple PHP)

Get Adobe Flash player

here is the source:

2 Comments

  1. 九月 30th, 2009
    REPLY))

  2. Thats very good to know… thanks

    1F

  3. 十一月 27th, 2009
    REPLY))

  4. Really like this site, would you mind if I link to it from my blog?

    2F

Leave a Reply

 Name

 Mail

 Home

[Name and Mail is required. Mail won't be published.]