80,351
社区成员
发帖
与我相关
我的任务
分享
public void setScale(float sx, float sy, float px, float py) Set the matrix to scale by sx and sy, with a pivot point at (px, py).The pivot point is the coordinate that should remain unchanged by the specified transformation.
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.test);
canvas.drawBitmap(bitmap, 0, 0, null);
Matrix matrix = new Matrix();matrix.setScale(0.5f, 0.5f, 200, 299);
canvas.drawBitmap(bitmap, matrix, null);
Matrix matrix = new Matrix();matrix.setScale(0.5f, 0.5f, 10, 10);
canvas.drawBitmap(bitmap, matrix, null);