防止位图太大而无法上传到纹理android [英] Prevent bitmap too large to be uploaded into a texture android

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

问题描述

我需要以图库形式全屏显示原始图像.对于拇指,它将完美运行,当我尝试使用原始来源全屏显示该图像时,它将无法显示.在大多数情况下,如果图像分辨率大于 2000,则会显示错误位图太大,无法上传到纹理 android.

I need to display original image in full screen in gallery form. For thumb it will be work perfectly and when I try to display that image in full screen with original source it will not be able to display. In most cases if the image resolution is greater then 2000 then it will display error bitmap too large to be uploaded into a texture android.

我想阻止这种情况,我在谷歌上搜索过,但没有得到任何关于此的答案.

I want to prevent this, I have search google but not getting any answer regarding this.

推荐答案

我遇到了同样的问题,并为这个问题想出了一个单一的解决方案 此处:

I came across the same problem and came up with a one liner solution for this problem here:

Picasso.with(context).load(new File(path/to/File)).fit().centerCrop().into(imageView);

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

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