如何调整在Android的原始图像 [英] how can resize the original image in android

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

问题描述

我的工作形象,上传原创图片在这原始图像调整小图像保存到数据库中这一形象

i am working on image ,upload original image in this original image resize the small image this image saved in to database

原始图像 - >调整它的大小(小图) - >小的图像保存在数据库

original image --> resize it (small image )--> small image saved in to database

请正解

感谢

推荐答案

要做到这一点你要玩的Bitmap类。

To do this you'll want to play around with the Bitmap class.

它有几个函数来创建新的位图形式previous那些

It has several functions to create new bitmaps form previous ones

Bitmap bmp2 = Bitmap.createScaledBitmap(bmp, width, height, true);

的完整列表可以在文档中找到:

a full list can be found in the documentation :

http://developer.android.com/reference/android/graphics/ Bitmap.html

关于保存到数据库中,我从来没有做过,但是这将取决于您的服务器上。

Regarding the save to a database I've never done but it would depend on your server.

这篇关于如何调整在Android的原始图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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