源码
private Bitmap getMyImg(Bitmap rootImg, int goalW, int goalH) {
int rootW = rootImg.getWidth();
int rootH = rootImg.getHeight();
// graphics 包下的
Matrix matrix = new Matrix();
matrix.postScale(goalW * 1.0f / rootW, goalH * 1.0f / rootH);
return Bitmap.createBitmap(rootImg, 0, 0, rootW, rootH, matrix, true);
}
问题询问:hellolxb@yeah.net