这似乎是一件容易的事,但我已经搜索了几个小时,到目前为止还没找到任何东西。我有一个ImageIcon,我想以某个角度旋转。
最简单的方法是什么?
编辑:我尝试将ImageIcon转换为BufferedImage,并旋转Graphics2`bPlayerImage = new BufferedImage( playerSize,playerSize,BufferedImage.TYPE_INT_RGB);
Graphics2D g = (Graphics2D)bPlayerImage.getGraphics();
g.rotate(Math.toRadians(turnAngle));
g.drawImage(playerImage, x, y, null);`
图像似乎不会旋转。