yo, sorry i didn't post any code to begin with. but ahh... here ya go.
to copy the frame buffer to main, do somethin like this
GLuint * framebuffer = new GLuint[screen_width * screen_height];
glReadPixels(0,0,screen_width,screen_height,GL_RGBA,GL_UNSIGNED_INT,frameBuffer);
note: I'm assuming the mode will be GL_RGBA, but it could be any number of things depending how you have it set.
note2: I'd put it into a uint, cause that makes sense to me. But GLubyte would make sense as well. But if you did, you'd have to alter the size of the array accordingly.
If you're double buffering you'll have to specify weather to read from the front buffer or back buffer.
use glReadBuffer() to control which buffer to read from (read from the front buffer to avoid any issues with copying a half drawn image).
kay, then what ya' gotta do is save that all to a file. If you save it as is... you should be able to open it in photoshop as a .raw file, but, it might be flipped, and if you dont want to do it after, you'll have to be clever and flip it in code. Or... write it out to the file back to front.
Or... just grab the jpeg library and let it do all the work. But I don't know anything about it off the top of my head, Sorry.
Hope that helped