<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16608" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>Hi All!<BR>I'm
trying to make a screenshot of the QVTKWidget with <BR>QPixmap::grabWidget().
But this results in a gray picture. I've got the same <BR>problem in ParaView
(3.0.2) when I save a screenshot as pdf file.<BR>I'm using VTK 5.0.3 with QT
4.3.3.<BR>Below you will find a simple test
program.<BR><BR>Regards,<BR>Manuel<BR><BR>#include <QtGui><BR>#include
<vtkRenderWindow.h><BR>#include <vtkRenderer.h><BR>#include
<vtkPolyDataMapper.h><BR>#include <vtkSphereSource.h><BR>#include
<QVTKWidget.h><BR>#include
"MainWindow.h"<BR>MainWindow::MainWindow()<BR>{<BR>testAction = new
QAction(tr("&Test"), this);<BR>connect(testAction, SIGNAL(triggered()),
this, SLOT(test()));<BR>testMenu =
menuBar()->addMenu(tr("&Test"));<BR>testMenu->addAction(testAction);<BR>createMainWidget();<BR>showMaximized();<BR>}<BR>void
MainWindow::createMainWidget()<BR>{<BR>mainWidget = new
QVTKWidget(this);<BR>vtkSphereSource* sphere =
vtkSphereSource::New();<BR>vtkPolyDataMapper* mapper =
vtkPolyDataMapper::New();<BR>mapper->SetInput(sphere->GetOutput());<BR>vtkActor*
actor = vtkActor::New();<BR>actor->SetMapper(mapper);<BR>vtkRenderer* ren =
vtkRenderer::New();<BR>ren->AddActor(actor);<BR>mainWidget->GetRenderWindow()->AddRenderer(ren);<BR>setCentralWidget(mainWidget);<BR>}<BR>void
MainWindow::test()<BR>{<BR>QPixmap pix =
QPixmap::grabWidget(mainWidget);<BR>pix.save("C:/Test.bmp");<BR>}
</FONT><BR></FONT></DIV></BODY></HTML>