Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thisma

macrumors member
Original poster
Thank you

I'm trying to find the color data, most importantly the alpha, for an arbitrarily chosen point or pixel in a png I have assigned to a UIImage.
My friend and I have been searching google and the frameworks for hours with no leads.

Please help,
thisma
 
Core Graphics. Create a bitmapcontext, draw your image into the context, read the pixels to your heart's delight.

google CGBitmapContextCreate & CGContextDrawImage
 
That's for creating a new image. I think he wants to get the raw data from an existing image, which CGImageGetDataProvider() will do. See here for more info.
http://developer.apple.com/qa/qa2007/qa1509.html

That's probably enough for us to state making it work. I'm concerned that this will be more memory intensive than I'd like.
The main thing still remaining is, I'm a little bit of a noob and I don't see what to write to pull the data from pixel x,y. I'll read over it again though.

BTW thank you both of you.
 
did you guys figure out a solution for this?

im am in desperate need of knowing how to do this, please post solution if you have one

-jeff
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.