package { import flash.display.Bitmap; import flash.display.PixelSnapping; [SWF(width=1200, height=600, backgroundColor=0xFFFFFF)] /** * Shows an image scaled up with smoothing applied and without. */ public class graphic_flex_image_effects_03_Flex_SmoothingTest extends graphic_flex_image_effects_03_Flex_AbstractImageLoader { /** * Constructor. Sends path to image to load to super class. */ public function graphic_flex_image_effects_03_Flex_SmoothingTest() { super("graphic-flex-image-effects-assets-brighton.jpg"); } /** * Scales up and displays two copies of loaded image. */ override protected function runPostImageLoad():void { // first bitmap is not smoothed var bitmap:Bitmap = new Bitmap(_loadedBitmap.bitmapData); bitmap.scaleX = bitmap.scaleY = 3; addChild(bitmap); // second bitmap is smoothed bitmap = new Bitmap(_loadedBitmap.bitmapData, PixelSnapping.AUTO, true); bitmap.scaleX = bitmap.scaleY = 3; bitmap.x = 600; addChild(bitmap); } } }