[Adobe AIR] Dr Android Answers: Resizing Images
Yesterday I tried to create an Adobe AIR project with a background image. I have resized the image (bg.width = 1024; bg.height = 768) and it looks jagged and with the blank area on the left. May I know why this happen?
Regards, Siew Wei
If there is a blank area on the left, I’m pretty sure you missed out this code:-
stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE;
Resize the image BEFORE you use it in ActionScript. Jaggedness is expected to happen when you resize it in ActionScript. Usually, when we resize an image, we would apply a blur filter afterwards. But ActionScript doesn’t do that itself – as there are some situations where it might not be what you want. So if you want to anti-alias any jaggedness – you’d apply the filter yourself.
I know that you’re writing an app for both tablet devices and smaller mobile screens. The plan is to work from a resolution of 1024×768 for the iPad/Android Tablet. Resize down to 960×640 for the iPod/iPhone, or whatever the resolution of the Android phone is. There will be jaggedness, but perhaps it won’t be noticeable on a smaller screen. But if you see jaggedness, apply a BlurFilter(). (maybe try stage.quality=StageQuality.BEST; … but I don’t think this will make a difference).