Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Rotating images in Java?

Started by Punx409 Aug 13, 2002 at 8:18 PM 0 replies 250+ views
Original Post
Punx409
Punx409
How would I go about rotating an image in Java?
Viro
Viro
Take a look at the java.awt.geom.AffineTransform class.

If you wanted to draw a rotated image, you''d do

g.drawImage(myImage, AffineTransform.getRotateInstance(45, 25,25));

That rotates the image 45 degrees at the anchor point 25, 25.

Hope that helps.
"Linux is not about free software, it is about community," -- Steve Balmer, Microsoft Chief Executive.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.