Rotate image along with touch to fix point in android
I am trying to rotate image in image view coresponding with touch to fix pivote pint of image . i have seen many of example but i dont clear with all of it .somebody have idea ..how can开发者_开发问答 do it this this ?
Since there is no code or details provided about where the bitmap is drawn i assume its at the center of the screen. You can rotate the canvas on center point like this
double rotationAngleRadians = Math.atan2(currentX - centerX, centerY - currentY);
rotationAngleDegrees = (int) Math.toDegrees(rotationAngleRadians );
canvas.rotate(rotationAngleDegrees , centerX, centerY);
精彩评论