Problem: Images when loaded into flex look blurred, distorted or poor quality.
Solution: Fixing the loaded images using smoothing .
![]() |
|
Before Smoothing |
After Smoothing |
<![CDATA[
//call this function from where ever you need Image Smoothing .Code by http://askmeflash.com
private function smoothImage(evt:Event):void{
var myBitmap:Bitmap = ((evt.target as Image).content as Bitmap);
if (myBitmap != null) {
myBitmap.smoothing = true;>
}
}
]]>
</mx:Script>
<!--Usage: call complete="smoothImage(event) from image component ) -->
<mx:Image id="myId" source="a.jpg" x="400" width="350" height="350" complete="smoothImage(event)" />
<mx:Image id="img1" source="b.jpg" x="400" y="400" width="300" height="150" complete="smoothImage(event)" />
</mx:Application>
//mxml ends here