Copy link to clipboard
Copied
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?
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.
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);
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)
Copy link to clipboard
Copied
anyone?
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.
Copy link to clipboard
Copied
Thank you! Much appreciated!
Copy link to clipboard
Copied
If you're all aet please mark a correct/helpful answers so we can filter unanswered.
You're welcome and good luck!