com.bumpslide.util.ImageUtil
static function smoothImage(holder_mc:MovieClip, image_mc:MovieClip)Smooths a dynamically attached JPG When resizing or rotating dynamically attached images, you can now apply smoothing in Flash 8 by taking a snapshot of the image as BitmapData and then attaching that bitmap over the old image
holder_mc | MovieClip where bitmap will be attached |
image_mc | MovieClip that will be copied into holder |
static function undoSmoothing(holder_mc:MovieClip, image_mc:MovieClip)Undo smoothing applied using the smoothImage function
holder_mc | |
image_mc |
static public function resizeRect(original:Rectangle, bounds:Rectangle, allowStretching:Boolean)
Resizes an image or rectangle to fit within a bounding box
while preserving aspect ratio. The third parameter is optional.
AllowStretching allows the image bounds to be stetched beyond the
original size. By default this is off. We use this most often for sizing
dynamically loaded JPG's, and we don't want them to be stetched larger
Example:
var origSize, availableSpace, newSize : Rectangle;
origSize = Rectangle.rectOfMovieClip( image_mc );
availableSpace = new Rectangle(0,0,500,300);
newSize = ImageUtil.resizeRect( origSize, availableSpace );
image_mc._width = newSize.width;
image_mc._yscale = image_mc._xscale;
original | - image size as a rectangle, max dimensions if allowStetching is left to false |
bounds | - the target size and/or available space for displaying the image |