]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Possibility to dump view content to JPEG image file
authorouv <ouv@opencascade.com>
Fri, 16 Mar 2007 10:26:49 +0000 (10:26 +0000)
committerouv <ouv@opencascade.com>
Fri, 16 Mar 2007 10:26:49 +0000 (10:26 +0000)
src/GLViewer/GLViewer_ViewFrame.cxx

index 38edf40b1027635e11c182c5b427a239159ce868..d01b7262c04c1678e2bd409d996758b4e090c65f 100644 (file)
@@ -414,7 +414,7 @@ QImage GLViewer_ViewFrame::dumpView()
 */
 void GLViewer_ViewFrame::onViewDump()
 {
-    QString aFilter( "*.bmp\n*.png" );
+    QString aFilter( "*.bmp\n*.png\n*.jpeg" );
 
     QFileDialog aFileDlg( QDir::current().absPath(), aFilter, this );
     aFileDlg.setCaption( tr( "DUMP_VIEW_SAVE_FILE_DLG_CAPTION" ) );
@@ -444,9 +444,17 @@ void GLViewer_ViewFrame::onViewDump()
         aSaveOp = "BMP";
     }
     else if( aFileExt == "*.png" )
+    {
         if( aTypedFileExt.isEmpty() )
             aFileName += ".png";
         aSaveOp = "PNG";
+    }
+    else if( aFileExt == "*.jpeg" )
+    {
+        if( aTypedFileExt.isEmpty() )
+            aFileName += ".jpeg";
+        aSaveOp = "JPEG";
+    }
 
     QImage anImage = dumpView();
     if( !anImage.save( aFileName, aSaveOp ) )