views:

11

answers:

1

I want to find out what the original height and width is for an uploaded image.

1) I want to control the height and width of the image manually relative to it's original dimensions.

2) I want to measure the DPI of the image as it is being scaled.

3) I'm having difficulty populating spark List containers without manually adding height and width properties.

From what I can see the mx:image component (after you set the image source) maintains a height and width of 0. If flash does indeed set these properties after the image is loaded, then:

1) What event can I listen for so I can go in and get these properties after they have been set.

2) What method can I call to resize all the components in a List control?

In some of the cases I am setting the image source to an external URL. In other cases I am setting the image source to an internal ByteArray which was obtained through the FileReference class.

A: 

a lot of questions, I'll try to answer the one I think I know the solution ;)

1) There are several attributes at the image component:

width/contentWidth/content.width

See also this blog post. It seems you need to look for contentWidth (scaled) and content.width (no scaling)

2) DPI meens dot per inch, without any knowledge about the physical monitor sizes you can't calculate the DPI of the image.


1) You can listen for the creationComplete-event. When this event is dispatched you should be able to access all (set) properties.

hering