官网英文原文:http://haxe.org/manual/haxe3_migration 混合类型数组 症状: 编译错误 Arrays of mixed types are only allowed if the type is forced to Array<Dynamic> 解释:Haxe 2允许这样定义混合数组: [1, "foo"],编译器会自动推断其类型为Array<Dynamic>
Haxe NME支持载入jpg和png格式的图像文件,如果想要把内存中的位图即BitmapData保存成文件,则可以使用haxelib中的hxformat库,这里简单介绍下如何保存位图为jpg格式。 下面的代码可以把BitmapData编码成JPEG格式,并返回JPEG格式的字节数组。 public function encodeJpeg(img: BitmapData) : Byte