RE: [flexcoders] Placement of Image within Image Control
All children are sized and positioned by their parent based on explicit or measured width/height. Images are extra tough because their size isn't known at first measure since the bits aren't fully loaded yet. Personally, I would just adjust its position when the "complete' event fires, but I also would expect the Container to handle this automatically. However, I've recommended you use Canvas so then you will have to position manually. If you decide to stick with boxes, we can look into this in more detail. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of droponrcll Sent: Monday, October 01, 2007 9:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Placement of Image within Image Control I have an Image control that is supposed to be centered in a VBox. The problem is that the image file itself may be of varying dimensions and aspect ratios. When the image is smaller than the image control it is in, it is always at the top left of the image control container, causing it to look off center. Are there any properties on the image control itself that say where to position the image within its container? Thanks.
Re: [flexcoders] Placement of Image within Image Control
I think you're looking for the Image.content property (inherited from SWFLoader). See the livedocs: http://livedocs.adobe.com/flex/201/langref/mx/controls/Image.html. The content is a child of the Image component (a light oversimplification here), and you should be able to set the x and y coordinates of the content to accomplish what you want. If this doesn't work I'll look closer at my code to see how I did it. - Dan Freiman On 10/1/07, droponrcll <[EMAIL PROTECTED]> wrote: > > I have an Image control that is supposed to be centered in a VBox. The > problem is that the image file itself may be of varying dimensions and > aspect ratios. When the image is smaller than the image control it is > in, it is always at the top left of the image control container, > causing it to look off center. Are there any properties on the image > control itself that say where to position the image within its > container? > > Thanks. > > >
[flexcoders] Placement of Image within Image Control
I have an Image control that is supposed to be centered in a VBox. The problem is that the image file itself may be of varying dimensions and aspect ratios. When the image is smaller than the image control it is in, it is always at the top left of the image control container, causing it to look off center. Are there any properties on the image control itself that say where to position the image within its container? Thanks.