I'm cropping a image in java swing, but when I select a part of image for cropping, I need to make selection part visible to user. Like a transparent rectangle on that image.
Asked
Active
Viewed 760 times
1 Answers
2
GraphPanel
shows one approach to rendering such a selection rectangle, mouseRect
. The rendering is controlled by the boolean selecting
attribute.
Addendum: Once you know the bounds of the selection, you can use getSubimage()
to clone the corresponding part of the image. There's a related example here.