Freehand Image Crop draw inside bitmap region

前端 未结 3 1962
面向向阳花
面向向阳花 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:41

    There is one way to achieve your goal..

    Follow below steps:

    1) Make one image like as inside part of crop image should be transparent and outside part should be background of canvas check below Image.

    2) Draw that image on top of your canvas.

    3) Draw anything on your canvas and drawagain that image on top of the canvas.

    Image:

    enter image description here

提交回复
热议问题