Step 1 : NbBytes = size.width() * size.height() * screen_pixel_format/8;
Step 2 : uchar *pPixelData = new uchar[NbBytes];
Step 3 : glReadPixels(0,0,size.width(),size.height(),GL_BGR_EXT,GL_UNSIGNED_BYTE,pPixelData);
Step
4 : QImage Image
(pPixelData, size.
width(),size.
height(), NbBytes
/ size.
height(),
QImage::Format_RGB888);
Step 5 : Image.save(FileName);
Step 1 : NbBytes = size.width() * size.height() * screen_pixel_format/8;
Step 2 : uchar *pPixelData = new uchar[NbBytes];
Step 3 : glReadPixels(0,0,size.width(),size.height(),GL_BGR_EXT,GL_UNSIGNED_BYTE,pPixelData);
Step 4 : QImage Image(pPixelData, size.width(),size.height(), NbBytes/ size.height(), QImage::Format_RGB888);
Step 5 : Image.save(FileName);
To copy to clipboard, switch view to plain text mode
Bookmarks