简体   繁体   English

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

[英]How do I get the width and height of an image?

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. 我正在用Actionscript 3(FlexBuilder)构造一本书籍,并试图根据其源文件的尺寸动态调整图像大小。 But, I've found that if I don't explicitly state the width and height of an image, they trace as 0. 但是,我发现,如果我未明确声明图像的宽度和高度,则它们的轨迹将为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? 为了缩小图像以适合给定的空间,我如何获得源图像的宽度和高度?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM