왜 비트 맵이 중간에 회전하지 않습니까?회전이 중간에 없음
sin을 사용하여 포인트를 회전시킬 때 o.k가됩니다. AffineTransform에 의한 Swing의 회전은 행렬의 회전에는 영향을주지 않습니다.
matrix.reset();
matrix.setRotate(35.0f,middleofx,middleofy);
Bitmap t=Bitmap.createBitmap(BI_auto);
Bitmap rotatedBitmap = Bitmap.createBitmap(t, 0, 0,
BI_car.getWidth(), BI_car.getHeight(), matrix, true);`
지점의 회전 작동 :
sx = ((carx) + 45 - worldx);
sy = ((cary) + 45 - worldy);
float rad = (float) (grad/180.0 * Math.PI);
float ex2 = (float) (sx + length* Math.sin(angle - rad));
float ey2 = (float) (sy + length* Math.cos(angle - rad));
녹색과 붉은 점은 빨간색 RECT에서 정확하지만, 그린 카 RECT가 잘못하고
나는이 코드를 사용 중간에 있지 않아.
잘못된 회전 비트 맵을 표시하십시오!