Bitmap Scaling Techniques

I have an app that makes use of many, externally loaded, graphics (gifs). These graphics are displayed throughout the application in different sizes and are animated with linear motion and “zooming” effects. My intention was to load all the graphics at the maximum needed size at 72 DPI, and then just size them down when needed, say, for a thumbnail. Since different bitmap instances can use the same BitmapData over and over again, I thought it would be inefficient to create both a full-size and a thumbnail image and load them both.

However, now that my program is up and running, I’m finding that when I resize these images, they look very bad. My resizing pseudo code looks something like this:

image
original_width, original_height
target_width, target_height

if(original_width > original_height) {
ratio = target_width / original_width
image.width = target_width
image.height = original_height * ratio
} else {
ratio = target_height / original_height
image.height = target_height
image.width = original_width * ratio
}

That’s the general idea of my algorithm, anyway… I’ve since discovered that I could use scaleX and scaleY, or I could use a transformation matrix and the draw() method. I’m not sure if any of these would make a difference and I wanted to ask some people who have experience with this before I spend too much time experimenting.

Can someone recommend a good approach (or the best approach, if one exists) for accomplishing something like this?