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.
I’m cropping a image in java swing, but when I select a part of
Share
GraphPanelshows one approach to rendering such a selection rectangle,mouseRect. The rendering is controlled by theboolean selectingattribute.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.