]> 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 12:07:41 +0000 (12:07 +0000)
committerdmv <dmv@opencascade.com>
Fri, 4 Jul 2008 12:07:41 +0000 (12:07 +0000)
src/SVTK/SVTK_MainWindow.cxx

index edfeb787a23d3d92dedc2181a927c6fd336f284b..a35d875671fdac1d20ee075e1af4a90655681828 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <vtkGenericRenderWindowInteractor.h>
 #include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
 
 #include <QtxAction.h>
 #include <QtxMultiAction.h>
@@ -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;
 }
 
 /*!