Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-13-2008, 03:32 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 44
Default RGB for a given X,Y Coordinate

Hello,

Let's say that I have a UIImageView. Is there a way to get the RGB color for a given X,Y coordinate inside of it?

Thank You.
74charger is offline   Reply With Quote
Old 12-13-2008, 03:49 PM   #2 (permalink)
Registered Member
 
RickMaddy's Avatar
 
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,122
Default

Read this:

Technical Q&A QA1509: Getting the pixel data from a CGImage object

Enjoy.
RickMaddy is offline   Reply With Quote
Old 12-13-2008, 04:10 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 44
Default

Thank you for replying.

Yea, I saw this and went through it. It wasn't give me consistent results.

I'll go through it again.

If you can think of anything else, I would appreciate it.
74charger is offline   Reply With Quote
Old 12-13-2008, 04:13 PM   #4 (permalink)
Registered Member
 
RickMaddy's Avatar
 
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,122
Default

What were the inconsistent results?

Your code needs to handle all the possible color layouts like RGBA, ARGB, 12 bit, 24 bit, 32 bit, LSB, MSB, etc.
RickMaddy is offline   Reply With Quote
Old 12-13-2008, 04:23 PM   #5 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 44
Default

I had a little test application with a white .png image with black borders. At times, when I clicked on the black border, the RGB was not 0,0,0 and/or when I clicked in the white area, it was not 255, 255, 255.

Thanks.
74charger is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,311
Threads: 89,035
Posts: 379,819
Top Poster: BrianSlick (7,086)
Welcome to our newest member, ramonpadillas
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:18 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0