private var _loader:Loader = new Loader( );
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_loader.load(new URLRequest("com/asxp/skin/assets/theme.jpg"));
public function onComplete(event:Event):void{
var image:Bitmap = Bitmap(_loader.content);
var bitmap:BitmapData = image.bitmapData;
image.width=this.stage.stageWidth;
image.height=this.stage.stageHeight;
this.addChild(image);
this.setChildIndex(image,0);
}
as3 load image
使用Loader加载图像并调整尺寸
最新推荐文章于 2022-01-21 22:37:23 发布
本文介绍如何在代码中使用Loader组件加载图像文件,并通过调整图像大小来适应舞台宽度和高度,确保图像在不同设备上的正确显示。
2万+

被折叠的 条评论
为什么被折叠?



