color selected part of image on touch

冷暖自知 提交于 2019-12-08 04:07:21

问题


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.

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.

来源:https://stackoverflow.com/questions/8788669/color-selected-part-of-image-on-touch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!