From: dmv Date: Fri, 4 Jul 2008 11:54:14 +0000 (+0000) Subject: 0019876: EDF VISU : Save pictures of animation problem X-Git-Tag: V4_1_4a1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2d118afe93fdfde564fe40e42ea2b136c3e6c0ba;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 045a05453..3d17e313b 100644 --- a/src/SVTK/SVTK_MainWindow.cxx +++ b/src/SVTK/SVTK_MainWindow.cxx @@ -30,6 +30,7 @@ #include #include +#include #include "QtxAction.h" @@ -895,6 +896,18 @@ QImage SVTK_MainWindow ::dumpView() { - QPixmap px = QPixmap::grabWindow( GetInteractor()->winId() ); - return px.convertToImage(); + 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, 32, 0, 256, QImage::IgnoreEndian); + + anImage = anImage.swapRGB(); + anImage = anImage.mirror(); + + return anImage; }