From 0bd498348c928ddfea8f8331f6f41e09321187d4 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 16 Mar 2007 10:26:49 +0000 Subject: [PATCH] Possibility to dump view content to JPEG image file --- src/GLViewer/GLViewer_ViewFrame.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GLViewer/GLViewer_ViewFrame.cxx b/src/GLViewer/GLViewer_ViewFrame.cxx index 38edf40b1..d01b7262c 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,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 ) ) -- 2.39.2