From the above image if I want a portion behind the RED Rectangle I can easily get it, but the issue I cannot get the portion behind the Yellow Rectangle because it is rotated.
So how can I get a portion of an image from a rotated shape on it?
For example my goal is to get a portion of an Image where the rectangle is located on the image. if someone rotates this rectangle by an x degree [in whatever direction] then it is getting difficult to extract the exact portion of an image after applying rotation.
you have to cut out the yellow rectangle and include transparent areas because the java 2d system, jframe, jpanel, paintcomponent only allows square rectangles as far as i know. it looks like you have some manual editing to do with the eraser tool in your favorite paint program.