简体   繁体   English

ImageSnapshot适用于较大尺寸的图像,可灵活调整尺寸

[英]ImageSnapshot for larger images in flex limit on size

I'm loading and displaying a large image say 6000 x 6000 px using an image tag. 我正在加载并使用图像标签显示一个大图像,例如6000 x 6000 px。 I wanted to take a snapshot of the image. 我想拍摄图像快照。 But the maximum limit I get is 2880 px dimensions using Flex 4, flash player 10. Didn't the limit of FP 10 increased to 4096 px? 但是使用Flex 4,Flash Player 10,我得到的最大限制是2880像素。FP 10的限制是否没有增加到4096像素? Then why am I getting 2880? 那我为什么要买2880? Is there a way to increase that size. 有没有办法增加大小。 Or any other method you suggest in doing so? 或您建议采用的其他任何方法?
Thanks. 谢谢。

您可以将其存储在一个ByteArray中的多个BitmapDatas和afaik中。

ImageSnapshot class uses BitmapData class to create a bitmap image of your screenshot before being converted to PNG or JPEG. ImageSnapshot类使用BitmapData类在转换为PNG或JPEG之前创建屏幕快照的位图图像。

Until flash player 9, BitmapData class was limited to 2880 pixels. 在Flash Player 9之前,BitmapData类仅限于2880像素。 But Since flash player 10, the limit is higher (around 8000pixels for height or width). 但是自Flash Player 10起,限制更高(高度或宽度大约为8000像素)。

But the ImageSnapshot wasn't updated. 但是ImageSnapshot没有更新。

Here I explain a workaround : 在这里,我解释了一种解决方法:

http://weflex.wordpress.com/2013/03/06/imagesnapshot-and-bitmapdata-size-limit/ http://weflex.wordpress.com/2013/03/06/imagesnapshot-and-bitmapdata-size-limit/

So far I can go till 4650pixels/ 到目前为止,我可以达到4650pixels /

Do note the method signature: public static function captureImage(source:*, dpi:Number=0, encoder:IImageEncoder=null, scaleLimited:Boolean=true):ImageSnapshot 请注意方法签名:公共静态函数captureImage(source:*,dpi:Number = 0,encoder:IImageEncoder = null,scaleLimited:Boolean = true):ImageSnapshot

So, have you tried: mySnapshot:ImageSnapshot = ImageSnapshot.captureImage(mySource, 200, mx.graphics.codec.JPEGEncoder, false); 因此,您是否尝试过:mySnapshot:ImageSnapshot = ImageSnapshot.captureImage(mySource,200,mx.graphics.codec.JPEGEncoder,false);

Note the last parameter == false, to disable scaleLimited... 注意最后一个参数== false,以禁用scaleLimited ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM