I have an image and I can draw a rectangle on the image as follows:
Rectangle rect = new Rectangle(x,y,width,height);
graphics2D.draw(rect);
Then I rotate the image and the drawn rectangle also rotates as expected. But now, how can I get a link to a newly rotated rectangle? I need the properties of a rotating rectangle, such as Point, Width, Height ....
I do not see that Graphics2D has a getShape () method? In addition, the rectangle passed to Graphics2D when invoking the draw (Rectangle) method does not change.
Any ideas?
source
share