1 Reply Latest reply on Jan 27, 2010 7:03 AM by Sophie_cordier

    Printing a snapshot




      I'd like to print a snapshot of a VBox.


      Creating the image using captureBitmapData works:


           var bitmap:BitmapData =

           var img:Image = new Image();
           img.source = new BitmapAsset(bitmap);



      The problem is that the image is pixellated. So I was looking for a way to increase the resolution, but keeping the final size of the image. I thought of using captureImage and setting a higher DPI value. After that I would have scaled the image back to the desired size. I Tried the following, but doesn't work:


           var imgSnapshot:ImageSnapshot =

                ImageSnapshot.captureImage(vBox, 300);
           var img:Image = new Image();

           img.source = imgSnapshot.data as ByteArray;



      The width and height of the img instance are not calculated automatically in the second case, whereas it is sone so in the first case; I'm sure that's the reason why it can't be printed.


      Am I using the captureImage method in the right way? Or has somebody any other tips to increase the resolution?