问题描述
解决方案
public static Bitmap createTargetSizeBitmap(int targetSizeBitmap image){ int w = image.getWidth(); int h = image.getHeight(); Matrix m = new Matrix(); m.postScale((float)targetSize/(float)w (float)targetSize/(float)h); return Bitmap.createBitmap(image 0 0 w h m true); }
时间: 2024-12-03 12:27:23