• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Sep 27, 2011 Sep 27, 2011

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

TOPICS
ActionScript

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 27, 2011 Sep 27, 2011

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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 27, 2011 Sep 27, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 28, 2011 Sep 28, 2011

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2011 Sep 28, 2011

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines