Tuesday, March 9, 2010

Image resize in Flash

var disp:DisplayObject = leftImageLoader.content as DisplayObject;
var thumbBMD:BitmapData = new BitmapData( 240, 149, false, 0xffffff );
var area3:Rectangle = new Rectangle( 0, 0, 240, 149);
var matrix:Matrix = DisplayUtils.fitIntoRect( disp, area3, true, Alignment.MIDDLE, false );
thumbBMD.draw( disp, matrix, null, null, null, true );
var thumb:Bitmap = new Bitmap( thumbBMD, "auto", true );
thumb.smoothing = true;
expandedImageLeft_mc.addChild(thumb);

No comments:

Post a Comment