Scaling larger Image problem.
        Posted  
        
            by krishna
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by krishna
        
        
        
        Published on 2010-03-19T07:15:01Z
        Indexed on 
            2010/03/19
            7:21 UTC
        
        
        Read the original article
        Hit count: 344
        
Hi,
I m developing flex application, in which I want to Draw Image from User local hard-drive to the canvas of size 640x360.
User can choose Image of bigger resolution & is scaled to Canvas size.
But if user selected images of larger resolution like 3000x2000, the scaling take lot time & freezes the application until scale done.
Is there any method to scale image faster or kind of threading can be done?
I am using matrix to scale Image as below:
    var mat:Matrix = new Matrix();
    var scalex:Number = canvasScreen.width/content.width;
    var scaley:Number = canvasScreen.height/content.height;
    mat.scale(scalex,scaley);           
    canvasScreen.graphics.clear();      
    canvasScreen.graphics.beginBitmapFill(content.bitmapData,mat);
        © Stack Overflow or respective owner