Copy link to clipboard
Copied
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
Rangrajan
Copy link to clipboard
Copied
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);
addChild(c);
toggle the true to false in the draw, to see the difference...
Copy link to clipboard
Copied
thanks dmennenoh for replying me with example and code. But I am doing as like you have told and getting poor quality than oroginal image.
regards
Rangrajan
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
thanks dmennenoh,
I am agree with u that with smoothing true image quality is much better than without smoothing. But I am getting much difference in quality when image has taken as screen short image with any extension as jpg/png/bmp/gif etc.
Can we get screen short image quality as like original after resize? Please help me ..
Regrads
Rangrajan.