how can resize the original image in android

一个人想着一个人 提交于 2020-01-31 05:45:31

问题


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

please forward solution

thanks


回答1:


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

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.



来源:https://stackoverflow.com/questions/4614354/how-can-resize-the-original-image-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!