我有一个很大的JPEG图像文件。它的尺寸是19000 * 14000,文件大小约为41M。我正在使用AIR 3.3 SDK,但加载完成后,我无法在舞台上看到图像。有谁知道这个问题的原因是什么?加载后无法显示非常大的图像
这里是我的代码:
protected function button1_clickHandler(event:MouseEvent):void
{
file = new File();
file.addEventListener(Event.SELECT, imageFileHandler);
file.browseForOpen("image file", [new FileFilter("image file","*.jpg;*.jpeg")]);
}
protected function imageFileHandler(event:Event):void
{
fs = new FileStream();
fs.openAsync(file, FileMode.READ);
fs.addEventListener(Event.COMPLETE, bytesComplete);
}
protected function bytesComplete(event:Event):void
{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoadHandler);
var bytes:ByteArray = new ByteArray();
fs.readBytes(bytes);
loader.loadBytes(bytes);
fs.close();
}
protected function imageLoadHandler(event:Event):void
{
image.source = (loader.content as Bitmap).bitmapData;
}
16777216像素总数,8192单维度,更精确。由于来自adobe的[documentation](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html)导致的 – Vesper 2013-05-08 11:41:08
,在空气3之后,图像尺寸没有更多限制。 – 2013-05-08 14:54:29
仍然有限制。从您的链接引用:从AIR 3和Flash Player 11开始,BitmapData对象的大小限制已被删除。 **位图的最大大小现在取决于操作系统。** – csomakk 2013-05-08 15:02:06