From: dmv Date: Fri, 4 Jul 2008 12:07:41 +0000 (+0000) Subject: 0019876: EDF VISU : Save pictures of animation problem X-Git-Tag: TG_TRIPOLI_qt4_porting~60 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=91dadfd245943747a7799407ecc2459081b39866;p=modules%2Fgui.git 0019876: EDF VISU : Save pictures of animation problem --- diff --git a/src/SVTK/SVTK_MainWindow.cxx b/src/SVTK/SVTK_MainWindow.cxx index edfeb787a..a35d87567 100644 --- a/src/SVTK/SVTK_MainWindow.cxx +++ b/src/SVTK/SVTK_MainWindow.cxx @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -909,8 +910,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; } /*!