如何获得图像的宽度和高度?

时间:2022-11-19 13:25:21

I'm constructing a book of sorts in Actionscript 3 (FlexBuilder) and am trying to size an image dynamically according to the dimensions of it's source file. But, I've found that if I don't explicitly state the width and height of an image, they trace as 0.

我正在使用Actionscript 3(FlexBuilder)构建一本书,并尝试根据源文件的大小动态调整图像大小。但是,我发现如果我没有明确说明图像的宽度和高度,它们会跟踪为0。

So that I can scale down an image to fit within a given space, how do I get the width and height of a source image?

因此,我可以缩小图像以适应给定的空间,如何获得源图像的宽度和高度?

2 个解决方案

#2


0  

A flash.display.Loader has width and height attributes.

flash.display.Loader具有width和height属性。

#1


#2


0  

A flash.display.Loader has width and height attributes.

flash.display.Loader具有width和height属性。