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

Can't do smooth bitmap scale down

Explorer ,
Jan 27, 2014 Jan 27, 2014

Copy link to clipboard

Copied

smooth.JPG

Hi,

I am working on text warping and below is a part of my code

var shape:Shape = new Shape();

shape.graphics.beginBitmapFill(bitmap.bitmapData.clone(), null, false, true);

As you can see I put "true" in "smooth" parameter and this performs bi-linear interpolation when the bitmap stretches out. 

However, when a large bitmap is scaled down, no interpolation is performed and result is not smooth (please see the inserted image)

What should I do to make the contents in bitmap looking smooth?

TOPICS
ActionScript

Views

854

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

correct answers 1 Correct answer

LEGEND , Jan 30, 2014 Jan 30, 2014

Have you simply draw()n the full size mesh warped version to a BitmapData, then used that BMD to scale?

I haven't mesh warped anything before importing but if you can draw that vector data properly into pixels (BMD) then you can scale that converted object using the matrix. A 2-step process isn't ideal but it's relatively inexpensive if you're not doing it every frame.

Votes

Translate

Translate
LEGEND ,
Jan 27, 2014 Jan 27, 2014

Copy link to clipboard

Copied

Supply a matrix instead of null with the correct percents you're changing the scale by.

e.g.

var scaleXPercent = 0.5; // half

var scaleYPercent = 0.5; // half

var matrix:Matrix = new Matrix();

matrix.scale( scaleXPercent , scaleYPercent );

var shape:Shape = new Shape();

shape.graphics.beginBitmapFill(bitmap.bitmapData.clone(), matrix, false, true);

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
Explorer ,
Jan 27, 2014 Jan 27, 2014

Copy link to clipboard

Copied

Thanks for the reply. But I can't put a matrix in the shape because I am doing "mesh warping" (http://macprovid.vo.llnwd.net/o43/hub/media/1090/7587/Pic_4.png)

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
Explorer ,
Jan 28, 2014 Jan 28, 2014

Copy link to clipboard

Copied

anyone?

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
LEGEND ,
Jan 30, 2014 Jan 30, 2014

Copy link to clipboard

Copied

Have you simply draw()n the full size mesh warped version to a BitmapData, then used that BMD to scale?

I haven't mesh warped anything before importing but if you can draw that vector data properly into pixels (BMD) then you can scale that converted object using the matrix. A 2-step process isn't ideal but it's relatively inexpensive if you're not doing it every frame.

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
Explorer ,
Jan 31, 2014 Jan 31, 2014

Copy link to clipboard

Copied

Thank you! Much appreciated!

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
LEGEND ,
Feb 02, 2014 Feb 02, 2014

Copy link to clipboard

Copied

LATEST

If you're all aet please mark a correct/helpful answers so we can filter unanswered.

You're welcome and good luck!

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