you have to take the snap shot of your canvas first
<mx:Canvas id="mycanvas"/>
<mx:Button click="makebyteArray()"/>
/**
* for sending bitmap data on the server u have to make the ByteArray
of that
* bitmap data by png encoder
*/
private function makebyteArray():void
{
var objBitmapData:BitmapData = takeSnapshot(mycanvas);
var pngData:ByteArray = PNGEnc.encode(objBitmapData);
}
/**
* pass ur canvas reference to this function it will return the
bitmapdata.
*/
private function takeSnapshot(source:IBitmapDrawable):BitmapData
{
var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData
(source);
return imageBitmapData;
}
now you can send this pngdata to the server
-------
Thanks
Rohit Bhatia
On Jun 2, 11:17 am, flex <[email protected]> wrote:
> hi all,
> i am using flex builder 3.0,
> i am doing 1 application where user can make drawing in canvas and
> can save it and store on server as a snap(image).
> please anybody tell me how can i read this canvas and send to server?
> thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---