color selected part of image on touch

2019-05-30 00:22发布

I am trying to color the image when user will touch the image.

I am using following code to color image, but in that I am able to fecth the RGB of the touch portion but not able to change the color.

Also I don't want to color whole image , see the image ,in that all the parts as having black border ,and once user will click on the particular part that color will be changed as per the color selected by user.

Please guide me how to change color for the selected part - also user will only touch one portion, and color will be filled automatically , but will not have to drag the finger to color the image.this is the sample image For above image - if user toches FACE then face color will be changes , same if touched leg then leg color will be changed.

Also from searching on google I found, CGMutablePath where we can provide color to image ,but this is also creating shapes by it self and not using the image.

One logic till the time I came to know is , we can store the point of image /parts of image in an ARRAY and on thouch event using that array MASK the image with other color or selected color, but do not have idea how to implement this things.

0条回答
登录 后发表回答