A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Resizing Bitmaps with Smoothing

  1. #1
    Army Web Designer
    Join Date
    Jun 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    140

    Resizing Bitmaps with Smoothing

    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?
    Jason Beaudoin
    Web Designer
    Canadian Army

  2. #2
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    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

  3. #3
    Army Web Designer
    Join Date
    Jun 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    140
    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);
    Jason Beaudoin
    Web Designer
    Canadian Army

  4. #4
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center