- 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);
来源: http://www.phpxs.com/code/1002836/