https://stackoverflow.com/questions/4837715/how-to-resize-a-bitmap-in-android
import android.graphics.Matrix
public Bitmap getResizedBitmap(Bitmap bm, int newWidth, int newHeight) {
int width = bm.getWidth();
int height = bm.getHeight();
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;
// CREATE A MATRIX FOR THE MANIPULATION
Matrix matrix = new Matrix();
// RESIZE THE BIT MAP
matrix.postScale(scaleWidth, scaleHeight);
// "RECREATE" THE NEW BITMAP
Bitmap resizedBitmap = Bitmap.createBitmap(
bm, 0, 0, width, height, matrix, false);
bm.recycle();
return resizedBitmap;
}
Search Knowledge Base Articles
Search selecet image width and height ,pick image from gallary
Did you find this article useful?
Related Articles
-
app mai language kaise add karni h Ref Link - https://codelabs.developers.google.com/codelabs/advanced-android-training-language-support/index.html?index=../..advanced-android-training#1
Create locale directories and resource files To add support for more locales, create additional directories inside res/. Each directory's name should ... -
Migrating to androidX
https://stackoverflow.com/questions/52960640/migration-to-androidx... -
Showing Custom Toast
https://www.sanfoundry.com/java-android-program-custom-toast-center-screen/... -
For showing the last visible item of the list.
https://stackoverflow.com/questions/26580723/how-to-scroll-to-the-bottom-of-a-recyclerview-scrolltoposition-doesnt-work .... -
Bug:- Google facebook login wasn't working in release only (Working correctly in debug) How to find: I write problem on google and find link 1
https://stackoverflow.com/a/55530139/12673134...