I want to get the color of the Pixel at a specific Touch Point on an EAGLView. Is this possible, and if so, how?
A:
You should be able to get the raw bitmap data using something similar to what is used in this question. From there, you can extract the byte values for the color elements at the point the touch occurred.
Brad Larson
2009-07-07 12:10:52
Thank you. This helped.
RexOnRoids
2009-07-08 06:33:24
You might consider using the code in my answer instead, since it does exactly what you want instead of reading all pixels copy them to a bitmap context and later decide to read one pixel from there.The code in the example quoted here is surely a million times slower.
nschmidt
2009-07-08 14:09:58
+5
A:
You can read a pixel with
unsigned int pixel;
glReadPixels( x, y, 1, 1, GL_RGBA, GL_UNSIGNED_INT, &pixel);
Depending on the format of your framebuffer you may have to use different values for the format and type parameters.
nschmidt
2009-07-07 20:14:24