Android的检测位图过大 [英] Android detect Bitmap too large

查看:135
本文介绍了Android的检测位图过大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有位图的问题太大,...
我可以调整与毕加索的形象。问题是,我必须检测当我必须调整图像大小。我怎么能当位图这将过大检测?我怎样才能得到最大的价值进行比较,如果我需要调整或不?

I have the problem of Bitmap too large to... I can resize the image with Picasso. The problem is that I have to detect WHEN I have to resize the image. How can I detect when the bitmap it’s going to be too large? How can I get the maximum value to compare if I need to resize or not?

我使用的:

int[] maxSize = new int[1];
gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0);

我测试了三星Galaxy S3 Mini和这个作品code。
我在三星Galaxy Note测试这个code 3,而不是工作。

I test this code in a Samsung Galaxy S3 mini and works. I test this code in a Samsung Galaxy Note 3 and not works.

不知道该怎么在一份报告3的情况下做的......

Dont know what to do in the case of a note 3...

推荐答案

在Android清单添加 hardwareAccelerated 标志设置为true,像这样的:

In your android manifest add the hardwareAccelerated flag set to true, like this:

<application
    ...
    android:hardwareAccelerated="true"
    ...
</application>

这篇关于Android的检测位图过大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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