Skip navigation
Currently Being Moderated

Show image quality as like original image after resize in as3.

Sep 27, 2011 2:38 AM

Hi Guys,


I am working on a Action Script3 project and i am showing images after resizing. I am using Bitmap and BitmapData manipulation for this but not getting image quality as like original image.  Please guide and help me with code that how can i do this.


Thanks & regards


  • Currently Being Moderated
    Sep 27, 2011 8:05 AM   in reply to Santosh Rangrajan

    How are you resizing? Normally, you would draw the original bitmap data into the new bitmap data, using a matrix to resize. To smooth scale, you need to use the smoothing option of the draw method. Here's a little sample that takes a library image and scales it to 500x500, using smoothing:


    var orig:BitmapData = new baseMap(); //library image

    var res:BitmapData = new BitmapData(500,500);


    var m:Matrix = new Matrix();

    m.scale(res.width / orig.width, res.height / orig.height);


    res.draw(orig, m, null, null, null, true);


    var c:Bitmap = new Bitmap(res);



    toggle the true to false in the draw, to see the difference...

    Mark as:
  • Currently Being Moderated
    Sep 28, 2011 3:25 AM   in reply to Santosh Rangrajan

    Let's see an example of your problem then. You're not going to get Photoshop quality scaling - in Flash this is scaling with the vector renderer, it's made for speed vs quality. But with smoothing on I find the scaling to be quite acceptable.

    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