]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0019876: EDF VISU : Save pictures of animation problem
authordmv <dmv@opencascade.com>
Fri, 4 Jul 2008 11:54:14 +0000 (11:54 +0000)
committerdmv <dmv@opencascade.com>
Fri, 4 Jul 2008 11:54:14 +0000 (11:54 +0000)
src/SVTK/SVTK_MainWindow.cxx

index 045a05453c584528882fefb33b6c06923a01eb83..3d17e313b12da67d4a9a00ab92f3fc07731d5b17 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <vtkGenericRenderWindowInteractor.h>
 #include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
 
 #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;
 }