The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 4 of 4

Thread: Resize a bitmap?

  1. #1

    Resize a bitmap?

    Oh man, this is really getting to me. Ive searched long and hard, and nothing is helping me. Or Im searching wrong. Either way... Im trying to make a simple painting app where you can paint on top of your own images. So I load an image from the server, and make it into a bitmap:

    var image:Bitmap= Bitmap(loader.content);
    Then I paint it onto a canvas using the beginBitmapFill method...

    (2) ata);,0,400,300);;
    However, the image loaded from the server is 640x480, and doesnt all fit into my small 400x300. How can I resize it a bitmap, so just before point 2 above???

    TIA, jamie

  2. #2
    You can't resize a BitmapData object.

    You'll need to draw your image to a new BitmapData object (of the size you want), applying a scale transform in the process (if you want to scale it) and display the new BitmapData

    var newBMD:BitmapData = new BitmapData(400,300); // or whatever size you want
    var image:Bitmap(loader.content);

    newBMD.draw(image.bitmapData, ...); // use matrix to scale the image during the draw



  3. #3
    Excellent! Thank you! Works like a charm.

  4. #4
    Your welcome

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012