I'm attempting to write code that will allow me to import a large Bitmap (jpg) and I want to resize it. I can do so, but it doesn't look all that great. I want to be able to redraw the bitmap smaller in actionscript. Is that possible?
Printable View
I'm attempting to write code that will allow me to import a large Bitmap (jpg) and I want to resize it. I can do so, but it doesn't look all that great. I want to be able to redraw the bitmap smaller in actionscript. Is that possible?
The newest build of Flash Player has built-in MIP mapping and looks a hell of a lot better on this kind of stuff. But unfortunately, most people don't use it yet. If you're loading images dynamically, I'd highly suggest using a back-end script with the PHP gdLib to resize the image on the back end; it will save the user a lot of download time, too. If there are only a few images that this needs to be done with, you should save them at several sizes beforehand...
See: http://www.php.net/gd
Thanks! Unfortunately, I'm working for the Government of Canada, and we don't use PHP, and they are very slow to implement new "back end" technologies.
Most of the images that are imported are sized to fit, however, I need to make my app almost dummy proof, so that if users want to use it for larger files, they can.
Can you point me in the right direction with regard to MIP mapping in Flash? Does it have something to do with the Matrix class?
The code I have thus far is simply:
var matrix:Matrix = image.transform.matrix;
matrix.scale(i, i);
image.transform.matrix = matrix;
image.smoothing = true;
addChild(image);
MIP mapping happens automatically since Flash Player 9.0.60.120. Tinic Uro explains it probably better since he made it:
http://www.kaourantin.net/2007/06/mip-map-what.html