How to get a UIView color of a perticular pixel(x,y)?

Nibbie
Posts: 1
Joined: 2009.03
Post: #1
Hi,

I am new bie to iphone sdk. How can I get a UIView's color at a specific point(x,y).

Here is the situation:
I draw a few circles (with border color white and background is black), and there is another view(a small rectangle) which has to movie within the circles.
So, when I know the border color of the circle, I will make the small rectangle object to move back.

I have searched all the way, but no luck so far
(I am using core graphics/Quartz)
Thank you,
Sridhar
Quote this message in a reply
Member
Posts: 142
Joined: 2002.11
Post: #2
ravi124 Wrote:Hi,

I am new bie to iphone sdk. How can I get a UIView's color at a specific point(x,y).

Here is the situation:
I draw a few circles (with border color white and background is black), and there is another view(a small rectangle) which has to movie within the circles.
So, when I know the border color of the circle, I will make the small rectangle object to move back.

I have searched all the way, but no luck so far
(I am using core graphics/Quartz)
Thank you,
Sridhar

There may be a better way, but you could try drawing into an CGBitmapContext, and then you can get direct access to the pixels.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How do I apply a perspective transform to a UIView and add to cocos2d sefiroths 0 3,256 Sep 24, 2012 05:45 AM
Last Post: sefiroths