Skip to content
December 20, 2010 / Daniel Freeman

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


To discuss MadComponents/MC3D, join the Facebook group!

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: