views:

62

answers:

1

I'm writing an simple application for users to upload an image, modify it and save it back to the HD.

Because most images are bigger than the image view of the app, they are scaled to fit. When te image is modified, it will be saved to the disk. At this point the quality of the image is bad.

Is it possible to scale an image for display but keep the quality?

Code i'm using now:

var loader:Loader=Loader(event.target.loader); 
var bmp:Bitmap = new Bitmap();
bmp = Bitmap(loader.content);

var widthScaleRatio:Number = 600 / bmp.width;
var heightScaleRatio:Number = 400 / bmp.height;

bmp.scaleX = scaleRatio;
bmp.scaleY = scaleRatio;

// THEN SAVE TO THE DISK
+1  A: 

Try to enable the smoothing, like this: bmp.smoothing = true;

Cornel Creanga
This is what you are looking for. It forces 'bmp' to render in vector mode instead of bitmap mode
Jason W