Does anyone got an ideia on how to get client side image resize using flash.
Example: Client chooses an image with 1200x800 and before it uploads it flash will turn
You need create a transformation matrix, then draw the original bitmap into a new one using it. Here's the idea in something i am just typing in and have not tested:
function resize(obm:BitmapData, scale:Number): BitmapData {
var resizeMatrix:Matrix = new Matrix();
resizeMatrix.scale(scale, scale);
var rbm:BitmapData = new BitmapData(obm.width * scale, obm.height * scale);
rbm.draw(obm, resizeMatrix);
return rbm;
}
I make no claims about the quality of the result, however. I think I remember trying this in the past, not liking the result, and punting...