Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 754
Unreality Avatar asked Aug 16 '09 23:08

Unreality


People also ask

How do you determine the color of a pixel?

Use the ColorSync Utility calculator to get the color values of a pixel on your screen. In the ColorSync Utility app on your Mac, click Calculator in the toolbar of the ColorSync Utility window. Click the magnifying glass , then move your pointer over an area on the screen that you want to examine.


1 Answers

A quick google search has revealed some promising leads:

  • Getting Pixel data from a CGImage object
  • Another StackOverflow question
  • What color is my pixel?
like image 143
Dave DeLong Avatar answered Oct 12 '22 16:10

Dave DeLong