在位图中加载大小大于 2880 的图像 [英] Load image of size greater than 2880 in Bitmap

查看:23
本文介绍了在位图中加载大小大于 2880 的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用位图加载图像,如果图像大小超过 2880 h/w,我会收到错误消息.

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); 

如果 canvasToPrint.width > 2880 或 canvasToPrint.width > 2880 我将在第 1 行得到以下错误错误:位图无效

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

为了解决上述问题,我使用了 bitmapdataunlimited 类,如下面的链接所述.

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

但它只适用于 4096 像素的高度和宽度,请指导我是否有任何替代解决方案来创建巨大的位图.

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

推荐答案

如果您的目标 FlashPlayer 有所不同:

If makes a difference which FlashPlayer you are targetting:

版本 VS 最大位图大小

flashplayer -9:2880x2880 像素
flashplayer 10:4096x4096 像素
flashplayer 11:无限

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

这篇关于在位图中加载大小大于 2880 的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆