Bitmap Smooth for resize big images
February 26th, 2009
Hi for all again, well today i was working with a loader class for a new project that use large images in background and these images can resized when resize browser or in different browser resolutions. When we load and add a large pictures into Flash it, when resized, distort the bitmap.
Well, reading and talking about the bitmap class here in agency we discovery the smoothing propertie for Bitmap data and the most important is to make it true you dont need change big codes. Basically you need put a simple code on complete function of your loader class.
21 | public function loadit(targetIt:String, smooth:Boolean = false):void |
I put the smooth as Boolean to use it only when i need and only load pictures – not work with swf files. But to activate the smoothing you need on your complete function put this code like show:
44 45 46 47 48 | if ( _smooth ) { var bmp:Bitmap = e.currentTarget.content; bmp.smoothing = true; } |
When e.currentTarget.content is equal the bitmap data that you loaded and after that you will put the bmp variable with smoothing equal true, aaaaaaaaaaand nothing more. So easy and great to work with large images into Flash. Lucky for all and cya.





Leave a Reply