Solved this little problem the simple way. One of the centralized file sharing applications we’re developing needed some form of branding at the bottom of the screens. The logo bar, 1400 px wide, needs to be resized when the user changes the resolution of the browserwindow.
Without smoothing, things turn ugly and pixelated. With smoothing turned on, everything keeps looking the way it should, even when resized.
<mx:VBox>
<mx:script>
private function smoothImage ( img : Image ) : void
{
var bmp : Bitmap = img.content as Bitmap;
bmp.smoothing = true;
}
</mx:script>
<mx:image id="logoImage" complete="smoothImage(logoImage)" source="images/logo.png" width="100%" scaleContent="true"/>
</mx:VBox>
Excellent.
Simple and Easy.
However this is just for initial load. On runtime you need to call smoothImage(logoImage); after each image transformation.
Thanks.
Can’t you use the resize event for that?
Actually once you have set the smoothing property to true it just uses smoothing, no matter if you scale or not.
Also, subsequent load of different images in the same object trigger the complete event as well, so this simple approach should always yield smooth bitmaps.