I wanted to write a method which gets a buffered image as parameter, rotates it 90 degrees clockwise around its top left corner, and then returns it. This method will be call from another method which then draws the rotated image on a rather large background which consists of many other images.
Here is the code I have so far
This method does rotate an image 90 degrees, but when the calling method recieves this image and displays it on the bigger frame, parts of the rotated image is cut. I think because the frame holding the returned image is not big enough. I've tried playing around with the code a lot, chaging the sizes of different images, and trying AffineTransform features, but I have had no luck.
The Rotated Icon allows you to treat an Image like an Icon which gives it more flexibility as you can just draw the Icon or add the Icon to any Swing component that supports Icons. It will also handle non square Icons.