glReadBuffer(GL_FRONT);
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei(GL_PACK_ALIGNMENT,4);
glPixelStorei(GL_PACK_ROW_LENGTH,0);
glPixelStorei(GL_PACK_SKIP_ROWS,0);
glPixelStorei(GL_PACK_SKIP_PIXELS,0);
int width = 1280;
int height = 1024;
int bytewidth = (width*4 +3 ) &~3;
char* raw_data = (char*)malloc( bytewidth* height);
glReadPixels(0,0,width,height,GL_BGRA_EXT,GL_UNSIGNED_INT,raw_data);
glPopClientAttrib();
wxImage image (width,height,raw_data );
image.SaveFile(“C:\ est.bmp”,wxBITMAP_TYPE_BMP);