From: nds Date: Thu, 31 Jul 2008 12:31:23 +0000 (+0000) Subject: It merges changes from BR_QT4_Dev for dumpView() functionality. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=61ca7a046c1be0663c04d5aa62693013973f0912;p=modules%2Fgui.git It merges changes from BR_QT4_Dev for dumpView() functionality. --- diff --git a/src/SVTK/SVTK_MainWindow.cxx b/src/SVTK/SVTK_MainWindow.cxx index 9e981c928..106edad4a 100644 --- a/src/SVTK/SVTK_MainWindow.cxx +++ b/src/SVTK/SVTK_MainWindow.cxx @@ -57,6 +57,7 @@ #include #include +#include /*! Constructor @@ -930,8 +931,19 @@ QImage SVTK_MainWindow ::dumpView() { - QPixmap px = QPixmap::grabWindow( GetInteractor()->winId() ); - return px.toImage(); + vtkRenderWindow* aWindow = GetInteractor()->getRenderWindow(); + int* aSize = aWindow->GetSize(); + int aWidth = aSize[0]; + int aHeight = aSize[1]; + + unsigned char *aData = + aWindow->GetRGBACharPixelData( 0, 0, aWidth-1, aHeight-1, 0 ); + + QImage anImage( aData, aWidth, aHeight, QImage::Format_ARGB32 ); + + anImage = anImage.rgbSwapped(); + anImage = anImage.mirrored(); + return anImage; } /*!