iPhone Objective C: How to get a pixel's color of the touched point on an UIImageView?

回眸只為那壹抹淺笑 提交于 2019-11-26 17:07:41

问题


iPhone Objective C: How to get a pixel's color of the touched point on an UIImageView, even if the parent UIView or itself is being rotated by the CGAffineTransformMakeRotation function?

Will the view property of the UITouch still correctly return the correct pixel of the touched point even if the UIView/UIImageView is being scaled and rotated?

Many thanks for reading

edited: Thanks for the answer & comments, but sorry I still don't know how to get the X,Y point of the scaled/rotated image from the touch event, and then extract the color from it. Would anyone mind to help?


回答1:


A quick google search has revealed some promising leads:

  • Getting Pixel data from a CGImage object
  • Another StackOverflow question
  • What color is my pixel?


来源:https://stackoverflow.com/questions/1285621/iphone-objective-c-how-to-get-a-pixels-color-of-the-touched-point-on-an-uiimag

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