我想旋转一个关于给定点的位图,并根据轴点转换结果位图
我尝试过:
//cart=some bitmap
Matrix matrix = new Matrix();
matrix.postRotate((float) angle,17,41);//17,41 is the pivot point
cart = Bitmap.createBitmap(cart, 0, 0, cart.getWidth(),cart.getHeight(),matrix, true);
canvas.drawBitmap(cart, 0,point, null);
// point = point where cart has to translated
旋转工作正常,但旋转后原点发生变化。所以我不知道我应该翻译多少才能达到预期的目的。我该怎么办?