Android缩放图片 Matrix,,int bmpWidth
分享于 点击 22575 次 点评:150
Android缩放图片 Matrix,,int bmpWidth
int bmpWidth = bmp.getWidth();int bmpHeight = bmp.getHeight();/* 设定图片放大的比例 */double scale = 1.25;/* 计算这次要放大的比例 */scaleWidth = (float) (scaleWidth * scale);scaleHeight = (float) (scaleHeight * scale);/* 产生reSize后的Bitmap对象 */Matrix matrix = new Matrix();matrix.postScale(scaleWidth, scaleHeight);Bitmap resizeBmp = Bitmap.createBitmap(bmp, 0, 0, bmpWidth, bmpHeight, matrix, true);
用户点评