Freehand Image Crop draw inside bitmap region

前端 未结 3 1958
面向向阳花
面向向阳花 2021-02-06 02:54

Trying to achieve freehand cropping of an image, so I\'m able to draw on the image. But it goes outside bitmap region. I just wanna restrict that user can only draw inside bitma

3条回答
  •  醉梦人生
    2021-02-06 03:44

    You can ignore all Touch Events that are outside your image view. Remember the last event location that is inside your image view and connect it with the next event location that is inside the view. This should work when both events are part of a single movement (without lifting your finger), but it might be more complicated when the drawing is done outside your view and then a new drawing starts inside. Try to cover this case too.

提交回复
热议问题