How do I crop an image in Java?

前端 未结 7 1338
逝去的感伤
逝去的感伤 2020-11-29 00:22

I want to crop an image manually using the mouse.
Suppose the image has some text, and I want to select some text from an image, then for that purpose I want to crop th

7条回答
  •  情歌与酒
    2020-11-29 00:37

    This question has not enough information to answer. A general solution (depending on your GUI framework): add a mouse event handler that will catch clicks and mouse movements. This will give you your (x, y) coordinates. Next use these coordinates to crop your image.

提交回复
热议问题