public void rotateText(Graphics g, String s, double angle, int x, int y)
{
Graphics2D g2d = (Graphics2D)g;
// Move the origin to the (x,y)
g2d.translate(x, y);
// Rotate the angle
g2d.rotate(Math.PI*(angle/-180));
// Draw text
g2d.drawString(s, 0, 0);
//Restore moving and rotating
g2d.rotate(-Math.PI*(angle/-180));
g2d.translate(-x,-y);
}
java DrawString 旋转问题
最新推荐文章于 2022-07-26 12:49:04 发布