"位图太大而不能上传到纹理" [英] "Bitmap too large to be uploaded into a texture"

查看:154
本文介绍了"位图太大而不能上传到纹理"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加载一个位图到一个ImageView的,看到这个错误。我收集这些限制涉及大小限制OpenGL硬件纹理(2048×2048)。我需要加载的图像是约4000像素的捏缩放图像中的高。

I'm loading a bitmap into an ImageView, and seeing this error. I gather this limit relates to a size limit for OpenGL hardware textures (2048x2048). The image I need to load is a pinch-zoom image of about 4,000 pixels high.

我试着关闭硬件加速在清单中,但没有喜悦。

I've tried turning off hardware acceleration in the manifest, but no joy.

    <application
        android:hardwareAccelerated="false"
        ....
        >

是否有可能加载图像大于2048像素到ImageView的?

Is it possible to load an image larger than 2048 pixels into an ImageView?

推荐答案

所有的渲染是基于OpenGL,所以没有你不能超过这个限制。 请注意,这将需要大量的内存。 有了这样的大图片,如果你要放大出来,在移动environement沉重内存的限制,应设置类似于您在谷歌地图,例如查看系统。随着图像分割在若干片,几个定义。

All rendering is based on OpenGL, so no you can't go over this limit. Note that this would take a huge amount of memory. With such big images, if you want to zoom in out, and in a mobile environement with heavy memory constraints, you should setup a system similar to what you see in google maps for example. With the image split in several pieces, and several definitions.

这篇关于&QUOT;位图太大而不能上传到纹理&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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