如何COM preSS图像的大小? [英] How to compress image size?

查看:126
本文介绍了如何COM preSS图像的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Android摄像头API来捕捉图像分辨率低,但是当我拍摄的图像,将设备camera.So的默认分辨率我想捕捉的图像分辨率低或小规模的捕获时间或哪能COM preSS原图成Android的小尺寸是多少?谁知道请帮助me..thnx

I want to capture image in low resolution using android camera api but when I captured image it will take default resolution of device camera.So I want to capture image in low resolution or small size at time of capture or how can I compress big image into small size in android?Anyone know pls help me..thnx

推荐答案

您可以用捕获的图像创建位图如下:

You can create bitmap with captured image as below:

Bitmap bitmap = Bitmap.createScaledBitmap(capturedImage, width, height, true);

在这里,您可以指定宽度要设置为您的ImageView位图和高度。的高度和宽度可以根据在装置的屏幕dpi的也设置,通过阅读不同设备的屏幕dpi的编程

Here you can specify width and height of the bitmap that you want to set to your ImageView. The height and width you can set according to the screen dpi of the device also, by reading the screen dpi of different devices programmatically.

这篇关于如何COM preSS图像的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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