开发者

Get width and height of embed image in Flex?

I have the follow declaration :

[Embed(source="i/6.png")]
private var img6 : Class;


You can determine size of embed image only on instantiation. Something like:

<s:BitmapImage source="{img6}" complete="completeHandler(event)" />
…
private function completeHandler(event:Event):void
{
    var image:BitmapImage = BitmapImage(event.currentTarget);
    trace (image.sourceWidth);
    trace (image.sourceHeight);
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜