开发者

Getting image size in ActionScript

Can I get the hei开发者_JAVA技巧ght of an image from its URL information in ActionScript 3?

I have the image URL. I want to draw the image in my UI and I want to set the height of the drawing area dynamically upon getting the image.


You can read the height/width of an image only after loading it to your SWF. Load the image using a Loader instance, cast the loader.content to Image, read the height and width of its bitmapData.


You can use the loader class. Once the image is loaded in the object, use loaderInfo for getting the image properties.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜