Two days ago this code capture perfectly the opengl screen, but now capture a black rectangle:
Code:
void Visor::BTNcaptura_click() { if (size.isValid()) { //QPixmap pixmap = QPixmap::grabWidget(glWidget, 0,0, size.width(), size.height()); <-- this capture a green rectangle QPixmap pixmap = glWidget->renderPixmap(size.width(), size.height()); <-- this capture a black rectangle tr("Archivos de imágenes (*.png *.jpg *.bmp *.jpeg *.ppm *.xbm *.xpm);;Todos los Archivos (*)")); if (!fileName.isEmpty()){ if (filter=="jpg") pixmap.save(fileName,"jpg"); ... else pixmap.save(fileName+".png","png"); } } }
What happend?