class FreshThread implements Runnable { @Override
public void run() {
int rotate = 0;
Paint paint = new Paint();
paint.setAntiAlias(true);
while (true) {
Canvas canvas = holder.lockCanvas(new Rect(0, 0, 300, 300));
canvas.drawColor(Color.BLACK);
try {
Matrix matrix = new Matrix();
matrix.setRotate((rotate += 30) % 360, (float) 189 / 2,
(float) 189 / 2);
Bitmap n = Bitmap.createBitmap(background, 0, 0, width,
hight, matrix, true);
canvas.drawBitmap(n, 0, 0, paint);
// canvas.drawBitmap(n, new Rect(0, 0, 200, 200), new
// Rect(0,
// 0, 200, 200), paint);
Thread.currentThread().sleep(1000);
} catch (Exception e) {
} finally {
holder.unlockCanvasAndPost(canvas);
}
}
}
}
就是我设置了图片旋转的原点之后   为什么图片旋转的同时还会从右下角向左上角来回移动呢???