hello,

I just draw a rectangle as follows:

glColor3f(1.0,.0,.0);
glBegin(GL_POLYGON);
glVertex2f(.0,.0);
glVertex2f(0.2,.0);
glVertex2f(0.2,1.0);
glVertex2f(.0,1.0);
glEnd();

my questions is:

-- what is the x,y, width and height adequate for glReadPixels(x,y, width,height,GL_RGB,GL_UNSIGNED_BYTE,data);
to retrieve only the color red (rectangle) knowing that the points of the rectangle are of type float?

--how to retrieve the values ​​of the parameter data, and save them in a text file ?

cordially