How to resize the original image in android

I am working on an image, loading the original image into this original image, resizing the small image. This image is saved in the database.

source image → resize (small image) → small image stored in the database

send solution

thanks

+4
source share
1 answer

To do this, you need to play with the Bitmap class.

It has several functions for creating new bitmaps from previous ones.

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

A complete list can be found in the documentation:

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

As for saving to a database that I never did, it would depend on your server.

+2
source

Source: https://habr.com/ru/post/1334490/


All Articles