Smoothing image loaded in Flash

11 03 2008

In our company we have been working on t-shirt customization tool for long time. Here people can upload their own picture and it is placed on t-shirt. They can rotate, resize, move and many other features. Infact all features t-shirt tools now-a-days offer.

Normally the image gets pixelated like normal html. So, whether the image is bigger or smaller always it’s little crippled. One of our client asked to make it smoother. Then I found Flash supports bitmap smoothing. After working on the code, I have made a small code snippet which will make any movieclip loading smooth image.

Just paste in the movieclip actionscript

onClipEvent(load)
{
        if(this.getBytesLoaded()>100)
        {
            import flash.display.*;
            var bitmap:BitmapData = new BitmapData(_width,_height);
            bitmap.draw(this);
            this._quality = “BEST”;
            this.attachBitmap(bitmap,1,”auto”,true);
        }
}

Interesting, huh?


Actions

Information

One response

7 07 2009
Hasib

its really Interesting and helpful to get height,width of movie clip after load another image into same movie clip and make the images smooth.
thanks.
…..
Hasib

Leave a comment