Scale an image without losing resolution
If I have a 1000x1000 png file, and load it into an imageView with the width at 100, can I then scale the image (animate) up …ie., zoom it up to a larger view without it looking like a pixelated version of the imageView?
Basically I am looking to zoom from a thumbnail to a full sized image.
When I do:
var imgView = Titanium.UI.createImageView({
image:imgFile,
width:100,
height:'auto'
});
var zoomImage = Titanium.UI.createAnimation();
t = Ti.UI.create2DMatrix();
t = t.scale(5.0);
zoomImage.transform = t;
zoomImage.duration = 400;
imgView.animate(zoomImage);
The zoomed image is pixelated. Yet the original on the hard drive is 1000x1000 - i'd love to see that in it's full glory.
Thanks for any insight.
3 Answers
-
Accepted Answer
Try to set backgroundImage:'/img.png' instead of image attribute
-
yeah that works - tho it appears that 'auto' does not work as a sizing option in this case? which i think i can work around so this is a good step. much thx.
-
I usually scale image for work needs, but my the resolution of image after scaling is still the same with the source image file. Is there difference between our image scalers?