Load image of size greater than 2880 in Bitmap

做~自己de王妃 提交于 2019-12-25 15:55:42

问题


I am using bitmap to load the image, if the image size is more than 2880 h/w I am getting an error.

BitmapData src = new BitmapData(canvasToPrint.width,canvasToPrint.height)(canvasToPrint.width, canvasToPrint.height);
src.draw(_designArea);  // -- encode the jpg        
var quality:int = 115; 
var jpg:JPEGEncoder = new JPEGEncoder(quality);                 
var byteArray:ByteArray = jpg.encode(src); 

if canvasToPrint.width > 2880 or canvasToPrint.width > 2880 I will get below error at line 1 Error : invalid Bitmap

To over come the above issue I have used bitmapdataunlimited class, as mentioned in the below link.

http://blog.formatlos.de/2008/05/28/bitmapdataunlimited/comment-page-2/#comment-4870

But it only works fine for 4096 pixel of height and width, guide me if any alternative solution is there to create huge bitmap.


回答1:


If makes a difference which FlashPlayer you are targetting:

versions VS maximum bitmapsize

flashplayer -9 : 2880x2880 px
flashplayer 10 : 4096x4096 px
flashplayer 11 : unlimited




回答2:


http://www.bit-101.com/blog/?p=2067

Try this



来源:https://stackoverflow.com/questions/6812462/load-image-of-size-greater-than-2880-in-bitmap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!