From 6d30942a32d57671123d21d8d2b796ed4915f594 Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 12 Mar 2007 12:07:01 +0000 Subject: [PATCH] Possibility to dump view content to JPEG image file --- src/GLViewer/GLViewer_ViewFrame.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ) ) -- 2.39.2