5-27-09 Update: Thanks to Winkyboy in the comments below, added smoothing to the resizing bitmaps.
Updates to my imageLoad class similar to the thumbnail class updates. Now it uses the UILoader component as well. This makes the image scale to fit the image area defined in the default parameters, instead of using the exact dimensions. Also fixed the way the outline around the image works.
To instantiate in fla:
import com.marianomike.imageLoad;
var image1:imageLoad;
var image:String = "http://farm4.static.flickr.com/3181/3076099910_ac5b2b8a2f.jpg?v=0";//path to image
//imageLoad(img_image:String, img_width:uint, img_height:uint, bgColor:uint, outlineColor:uint, outlineSize:uint, txtColor:uint, showDrop:Boolean, scale:Boolean)
image1 = new imageLoad(image, 400, 266, 0x000000, 0x333333, 2, 0xFFFFFF, false, true);
addChild(image1);
[...] Update: I’ve created another class that uses the UILoader component, if you want to see that version go here: http://marianomike.com/2009/03/13/as3-image-load-class-11/ [...]
Is it possible to apply smoothing to the images loaded in this way, or does that not work with UILoader?
Naturally, I thought of the answer a moment after posting that.
After adding this to the package:
import flash.display.Bitmap;
…then in the showLoadResult function I added:
var img_bm:Bitmap = new Bitmap();
img_bm = Bitmap(img_loader.content);
img_bm.smoothing = true;
That’s awesome! Thanks, I’ll add that and update!