Skip navigation
Currently Being Moderated

How to get scaled copy of bitmapData of an Image?

Apr 6, 2011 5:49 PM

For the class  spark.components.Image

 

I can access the bitmapData object  (readonly) (unscaled).

I know the scaling factors of the Image.

 

How  can I get a scaled version of the bitmapData?

 

Thanks!

 
Replies
  • Currently Being Moderated
    Apr 6, 2011 7:29 PM   in reply to TheOriginalEdge

    If you mean you need to make a new BitmapData that uses the one you get from Image instance to fit particular dimensions - use BitmapData.draw() method and Matrix index with Matrix.scale() called with desired values.

     

    Here is a link to BitmapData.draw() documentation:

     

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fla sh/display/BitmapData.html#draw()

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 6, 2011 9:04 PM   in reply to TheOriginalEdge

    draw() on BitmapData doesn't display anything per se. You have to place Bitmap containing this BitmapData on display list in order for it to be visible.

     

    Yes, if you apply Matrix to new data - it will scale new BitmapData instance.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points