I have an image on JPanel. Then I draw a rectangle over the image as follows:
Graphics2D image = (Graphics2D) g;
image.drawRect(......);
//create image code here.
image.rotate(1.5);
image.drawImage(....);
The problem is that when I rotate the image.rotate (1.5) image, the rectangles remain in the same place.
I tried to create a rectangle before rotating the image and after rotating the image, but both times it fails.
Is there an easy way to make the rectangles also rotate with the image?
Thank.
source
share