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)
here is the source:
Thats very good to know… thanks
Really like this site, would you mind if I link to it from my blog?