Ich versuche Bitmap aus gallery.I, um die Größe schrieb einige Code, und ich kann Bitmap nur statische Breite und height.this ist Quelleandroid Resize Bitmap Auto Höhe
public Bitmap getResizedBitmap(Bitmap bm, int newWidth) {
float aspectRatio = (float)bm.getWidth()/(float) bm.getHeight();
int height = Math.round(newWidth/aspectRatio); //based on width it gives height
Matrix matrix = new Matrix();
matrix.postScale(newWidth, height);
Bitmap resizedBitmap = Bitmap.createBitmap(
bm, 0, 0, newWidth, height, matrix, false);
return resizedBitmap;
}
, aber ich möchte, um die Größe Bitmap zum Beispiel Breite die Größe 800px und auto höhe. Ist es möglich, dieses problem in android zu lösen? dank
[diesen Link verweisen] (http://stackoverflow.com/questions/3331527/android-resize-a-large-bitmap-file-to-scaled-output-file) i auch bekam Lösung für gleiche Problem von diesem Link –