mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0023931: Incorrect image export code in MFC sample: Added OCC_BaseDoc::ExportView() method to unify image export procedure in all MFC samples.
Compilation errors were corrected.
This commit is contained in:
@@ -121,36 +121,7 @@ void OCC_2dView::OnInitialUpdate()
|
||||
|
||||
void OCC_2dView::OnFileExportImage()
|
||||
{
|
||||
LPCTSTR filter;
|
||||
filter = _T("EXR Files (*.EXR)|*.exr|TGA Files (*.TGA)|*.tga|TIFF Files (*.TIFF)|*.tiff|"
|
||||
"PPM Files (*.PPM)|*.ppm|JPEG Files(*.JPEG)|*.jpeg|PNG Files (*.PNG)|*.png|"
|
||||
"GIF Files (*.GIF)|*.gif|BMP Files (*.BMP)|*.bmp|PS Files (*.PS)|*.ps|"
|
||||
"EPS Files (*.EPS)|*.eps|TEX Files (*.TEX)|*.tex|PDF Files (*.PDF)|*.pdf"
|
||||
"|SVG Files (*.SVG)|*.svg|PGF Files (*.PGF)|*.pgf|EMF Files (*.EMF)|*.emf||");
|
||||
CFileDialog dlg(FALSE,_T("*.BMP"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
filter,
|
||||
NULL );
|
||||
|
||||
|
||||
if (dlg.DoModal() == IDOK)
|
||||
{
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
|
||||
CString aFileName = dlg.GetPathName();
|
||||
CString ext = dlg.GetFileExt();
|
||||
if (!(ext.CompareNoCase("ps")) || !(ext.CompareNoCase("emf"))
|
||||
|| !(ext.CompareNoCase("pdf")) || !(ext.CompareNoCase("eps"))
|
||||
|| !(ext.CompareNoCase("tex")) || !(ext.CompareNoCase("svg"))
|
||||
|| !(ext.CompareNoCase("pgf")))
|
||||
{
|
||||
Graphic3d_ExportFormat exFormat;
|
||||
if (!(ext.CompareNoCase("ps"))) exFormat = Graphic3d_EF_PostScript;
|
||||
else exFormat = Graphic3d_EF_EnhPostScript;
|
||||
myV2dView->View()->Export( aFileName, exFormat );
|
||||
return;
|
||||
}
|
||||
myV2dView->Dump(aFileName);
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
|
||||
}
|
||||
GetDocument()->ExportView (myV2dView);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user