1. 图片放缩
// zoom 放缩
public static Bitmap zoomBitmap(Bitmap bitmap, int w, int h) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
Matrix matrix = new Matrix();
float scaleWidth = w / (float) width;
float scaleHeight = h / (float) height;
matrix.postScale(scaleWidth, scaleHeight);
Bitmap bitmap2 = Bitmap.createBitmap(bitmap, 0, 0, width, height,
matrix, true);
return bitmap2;
}
本文地址:https://www.stayed.cn/item/19506
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我