[vtkusers] vtkqt saving widget as an image
Clinton Stimpson
clinton at elemtech.com
Tue Jun 8 16:02:52 EDT 2004
I think grabWidget uses a different QPaintDevice which can explain why
you get the image you do.
Try QPixmap::grabWindow() instead. I'll get the pixels from the screen
instead of asking the widget to draw using a special paint device.
There are possible problems with that though. You can see the
documentation for that method which explains the problems. You can work
around those problems using VTK's methods.
Clint
>
>------------------------------
>
>Message: 3
>Date: Tue, 8 Jun 2004 11:16:18 -0700 (PDT)
>From: Matt Schmiermund <matt at plasticflow.com>
>Subject: [vtkusers] vtkqt saving widget as an image
>To: vtkhelp users list <vtkusers at vtk.org>
>Message-ID: <20040608181618.68957.qmail at web61004.mail.yahoo.com>
>Content-Type: text/plain; charset=us-ascii
>
>I am trying to save an image of Keubler's
>vtkQtRenderWindow. I am using
>QPixmap::grabWidget(vtkRenWin), which I have used
>before with success. However when I do this the
>resulting image is just a grey square the size of the
>vtkRenWin. When I grabbed the whole main window I got
>everything with it expect for the vtkQtRenderWindow.
>
>Has anyone successfully saved images of
>vtkQtRenderWindows through Qt? I saw that there are
>vtkPNGWriters and the like, but seemed a bit more
>complicated than the Qt method.
>
>I appreaciate any help.
>
>-Matt
>
>
>
>
More information about the vtkusers
mailing list