In Adobe Flex 3, you can get a bitmap image of any control by using this code (you'll need to import ""):

var snapshot:ImageSnapshot =  ImageSnapshot.captureImage(backgroundCanvas);

By default, it uses PNG encoding.

If you want to then send this image to the server, use this code:

var req:URLRequest = new URLRequest();
req.method = URLRequestMethod.POST; =;
req.url = "snapshotuploadhandler.aspx";
var loader:URLLoader = new URLLoader;

Reading the uploaded file is easy using ASP.NET:

private byte[] readPostedFile()
   if (Request.ContentLength > 0)
       byte[] buffer = new byte[Request.ContentLength];
       using (BinaryReader br = new BinaryReader(Request.InputStream))
           br.Read(buffer, 0, buffer.Length);
       return buffer;
       return null;