canvas.rotate(degrees)与canvas.rotate(degrees, px, py)

		canvas.save();
		mPaint.setColor(Color.YELLOW);
		mPaint.setStyle(Style.STROKE);
		canvas.drawCircle(150, 70, 5, mPaint);
		canvas.restore();
		canvas.save();
//		canvas.rotate(40.0f);//这个方法是将整个画布旋转,起点是按照当前画布计算位置的
		canvas.rotate(270.0f, 150, 70);//这个方法是将整个画布旋转,起点位置还是之前画布里面的150,70 点
		/* 设置颜色及绘制另一个矩形 */
		mPaint.setColor(Color.GREEN);
		canvas.drawRect(new Rect(150, 75, 260, 120), mPaint);
		canvas.restore();


 

你可能感兴趣的:(canvas.rotate(degrees)与canvas.rotate(degrees, px, py))