Hm, that's about canvases. Will that work for an mx:Image as well?
1 person found this helpful
Haven't tried it, but the right idea is there, if you use the scaleX and scaleY properties of Image, it just might work..
You will have to use the transform matrix to scale the image and then put it inside another container (like a canvas) that clips subviews.
Can you elaborate on that a bit please? I have not worked with Transform Matrixes too much.
I think scaleX and scaleY should do the trick, but haven't used those either. Flex 3 didn't have them.
Yes, Image in FB3 has the scaleX/Y props.
Here's what I do if the image is too wide for the box and I want to make it just as wide as the box, but cut off the top and bottom:
var scalefactor:Number = innerW/imgWidth;
var scaledHeight:int = imgHeight * scalefactor;
yOffset = innerH/2 - scaledHeight/2;
image.transform.matrix = new Matrix(scalefactor, 0, 0, scalefactor, 0, yOffset);
innerW/innerH are the width and height that you are trying to fit the image into.
Thanks! I'll give it a try tomorrow and comeback with a `verdict`.
Thanks a lot!