From: ouv Date: Mon, 12 Mar 2007 12:07:01 +0000 (+0000) Subject: Possibility to dump view content to JPEG image file X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCATH_dev;p=modules%2Fgui.git Possibility to dump view content to JPEG image file --- diff --git a/src/GLViewer/GLViewer_ViewFrame.cxx b/src/GLViewer/GLViewer_ViewFrame.cxx index 38edf40b1..951935503 100644 --- a/src/GLViewer/GLViewer_ViewFrame.cxx +++ b/src/GLViewer/GLViewer_ViewFrame.cxx @@ -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,18 @@ 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 ) )