如何在Android的调整(缩小)图像时,为了避免像素化? [英] How to avoid pixelation when resizing (shrinking) images on Android?

查看:90
本文介绍了如何在Android的调整(缩小)图像时,为了避免像素化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在调整用相机拍摄下来大约为1024×768的照片上传。在大多数Android设备上,我们的code工程确定,但在一些他们不这样做(如摩托罗拉光子4G,Galaxy Nexus的,摩托罗拉Droid X2)。

We are resizing photos taken with the camera down to about 1024x768 for uploading. On most Android devices, our code works ok, but on some they don't (such as Motorola Photon 4G, Galaxy Nexus, Motorola Droid X2).

我们正在使用从这里code: http://stackoverflow.com/a/9234895/679339

We're using the code from here: http://stackoverflow.com/a/9234895/679339

但是,当它不工作,调整后的图像看起来是这样的:

But when it doesn't work, the resized image looks like this:

有人知道为什么吗?

推荐答案

的Andr​​oid调整大小是根据它的运行的装置的像素密度的图像。您需要获得该设备的显示尺寸和密度,以了解Android将尝试根据查看它试图把图像做你的照片到

Android resizes images based on the pixel density of the device its running on. You need to get the display size and density of the device in order to understand what Android will attempt to do to your photo based on the View its trying to put the image into

这篇关于如何在Android的调整(缩小)图像时,为了避免像素化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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