复制图像HAXE [英] Duplicate image with Haxe
本文介绍了复制图像HAXE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的目标是使只使用一个方形图像全图。 使用ActionScript 3的解决方案是简单地让从Loader新位图:
My goal is to make a wide map using only one square image. Using actionscript 3 the solution is to simply make new Bitmap from the Loader:
var loader:Loader = new Loader();
loader.load(new URLRequest("xyz.png"));
this.addChild(loader);
var duplicationBitmap:Bitmap = new Bitmap(Bitmap(loader.content).bitmapData);
不幸,HAXE API不允许这样做。我不能得到的位图数据从装载的内容...
Unluckily, Haxe API doesn't allow to do that. I can't get bitmapData from loader content…
任何人有一个线索?谢谢你。
Anyone has a clue? Thanks.
推荐答案
的API是非常相同的,所以我想这个问题是你如何试图投;尝试使用:
The API is the very same, so I guess the problem is how you are trying to cast; try using:
var duplicationBitmap= new Bitmap(cast(loader.content, Bitmap).bitmapData);
这篇关于复制图像HAXE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文