我做了一个球员课。在这个班级我做了一个绘制方法。 此方法返回一个Image。在主类中,我使用graphicContext绘制此Image。 我想旋转图像,但我不知道如何。
请帮我解决这个问题
public Image draw(){
return playerNormalImg;
}
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
答案 0 :(得分:0)
您必须使用Canvas
来旋转Image
,因为您正在编写棋盘,我想您要旋转180 degrees
Canvas canvas = ...
Image image = ...
GraphicsContext graph = canvas.getGraphicsContext2D();
graph.save();
graph.rotate(180);
graph.drawImage(image);
graph.save();