Flex (Flash Builder 4) modify image, keep quality
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
Try to enable the smoothing, like this: bmp.smoothing = true;
精彩评论