在java中旋转图像的最简单方法

时间:2013-04-28 14:16:15

标签: java image

请问我如何旋转图像最简单方式?

我的形象:

 g.drawImage(image, x, y, this);

1 个答案:

答案 0 :(得分:1)

Graphics2D g2d=(Graphics2D)g;       // Create a Java2D version of g.
g2d.translate(170, 0);              // Translate the center of our coordinates.
g2d.rotate(1);                      // Rotate the image by 1 radian.
g2d.drawImage(image, 0, 0, 200, 200, this);

来源:Rotate Image