Topic: Possible to resize image in Flash?

I'm working on a webcam project that loads webcam images from several different webcams. The problem is the different webcams have different image sizes.

Is there some way to shrink the pics down to the 320 x 240 Chumby screen?

Re: Possible to resize image in Flash?

I tend to do this on my own server, but it can be done in Flash through code. See Flash Help section, or:

Setting size, scale, and orientation
http://livedocs.adobe.com/flash/9.0/main/00000334.html

Re: Possible to resize image in Flash?

Thanks for the help. Agreed, I'd much rather do it on my webserver, but this is a webcam application possibly pulling an image every second, and the double bandwidth might add up.

That scale function is very nice. But it's problem (it seems to me) is that it's proportional, unless I'm wrong. Do you (or anyone) happen to know if there's some way to get info about the current image so I can know how much I need to scale it?

Or if there's some way to scale to exactly, say, 320x240?

4 (edited by DocSavage 2008-03-06 07:47:48)

Re: Possible to resize image in Flash?

Here is the code fragment that i use to do just what you are asking for:

if (target_mc._width>target_mc._height)
    {
        target_mc._width = 320;
        target_mc._height = 240;
        target_mc._x = 0;
    }
    else
    {
        target_mc._width = 240;
        target_mc._height = 340;
        target_mc._x = target_mc._x+40;
    }
The +40 in the last line is to center the image in the frame, if I remember correctly