void CGeometryView::OnFileExportImage()
{
CFileDialog dlg(FALSE,_T("*.BMP"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- _T("BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif | XWD Files (*.XWD)|*.xwd||"),
+ _T("BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif | PNG Files (*.PNG)|*.png"
+ "|JPEG Files (*.JPEG)|*.jpeg | PPM Files (*.PPM)|*.ppm | TIFF Files (*.TIFF)"
+ "|*.tiff | TGA Files (*.TGA)|*.tga | EXR Files (*.EXR)|*.exr||"),
NULL );
if (dlg.DoModal() == IDOK)
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
- CString filename = dlg.GetPathName();
- Handle(Aspect_Window) anAspectWindow = myView->Window();
- Handle(WNT_Window) aWNTWindow = Handle(WNT_Window)::DownCast(anAspectWindow);
- CString ext = dlg.GetFileExt();
- if (ext == "bmp") aWNTWindow->SetOutputFormat ( WNT_TOI_BMP );
- if (ext == "gif") aWNTWindow->SetOutputFormat ( WNT_TOI_GIF );
- if (ext == "xwd") aWNTWindow->SetOutputFormat ( WNT_TOI_XWD );
- aWNTWindow->Dump ((Standard_CString)(LPCTSTR)filename);
+ CString aFileName = dlg.GetPathName();
+ myView->Dump(aFileName);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
}
void CAnimationView3D::OnFileExportImage()
{
CFileDialog dlg(FALSE,_T("*.BMP"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- _T("BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif | XWD Files (*.XWD)|*.xwd||"),
+ _T("BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif | PNG Files (*.PNG)|*.png"
+ "|JPEG Files (*.JPEG)|*.jpeg | PPM Files (*.PPM)|*.ppm | TIFF Files (*.TIFF)"
+ "|*.tiff | TGA Files (*.TGA)|*.tga | EXR Files (*.EXR)|*.exr||"),
NULL );
if (dlg.DoModal() == IDOK)
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
- CString filename = dlg.GetPathName();
- Handle(Aspect_Window) anAspectWindow = myView->Window();
- Handle(WNT_Window) aWNTWindow = Handle(WNT_Window)::DownCast(anAspectWindow);
- CString ext = dlg.GetFileExt();
- if (ext == "bmp") aWNTWindow->SetOutputFormat ( WNT_TOI_BMP );
- if (ext == "gif") aWNTWindow->SetOutputFormat ( WNT_TOI_GIF );
- if (ext == "xwd") aWNTWindow->SetOutputFormat ( WNT_TOI_XWD );
- aWNTWindow->Dump ((Standard_CString)(LPCTSTR)filename);
+ CString aFileName = dlg.GetPathName();
+ myView->Dump(aFileName);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
}
void OCC_2dView::OnFileExportImage()
{
CFileDialog dlg(FALSE,_T("*.BMP"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- _T("BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif | XWD Files (*.XWD)|*.xwd||"),
+ _T("BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif | PNG Files (*.PNG)|*.png"
+ "|JPEG Files (*.JPEG)|*.jpeg | PPM Files (*.PPM)|*.ppm | TIFF Files (*.TIFF)"
+ "|*.tiff | TGA Files (*.TGA)|*.tga | EXR Files (*.EXR)|*.exr||"),
NULL );
if (dlg.DoModal() == IDOK)
CString filename = dlg.GetPathName();
Handle(WNT_Window) aWNTWindow=
Handle(WNT_Window)::DownCast(myV2dView->Driver()->Window());
- CString ext = dlg.GetFileExt();
- if (ext == "bmp") aWNTWindow->SetOutputFormat ( WNT_TOI_BMP );
- if (ext == "gif") aWNTWindow->SetOutputFormat ( WNT_TOI_GIF );
- if (ext == "xwd") aWNTWindow->SetOutputFormat ( WNT_TOI_XWD );
aWNTWindow->Dump ((Standard_CString)(LPCTSTR)filename);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
void OCC_3dView::OnFileExportImage()
{
LPCTSTR filter;
- filter = _T("BMP Files (*.BMP)|*.bmp|GIF Files (*.GIF)|*.gif|XWD Files (*.XWD)|*.xwd|PS Files (*.PS)|*.ps|EPS Files (*.EPS)|*.eps|TEX Files (*.TEX)|*.tex|PDF Files (*.PDF)|*.pdf|SVG Files (*.SVG)|*.svg|PGF Files (*.PGF)|*.pgf||");
+ 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 filename = dlg.GetPathName();
- char* theFile = new char[filename.GetLength()+1];
- //_tcscpy(theFile,filename);
- strcpy_s(theFile,filename.GetLength()+1,filename);
+ CString aFileName = dlg.GetPathName();
CString ext = dlg.GetFileExt();
- if (ext == "ps" || ext == "emf")
+ 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 == "ps") exFormat = Graphic3d_EF_PostScript;
+ if (!(ext.CompareNoCase("ps"))) exFormat = Graphic3d_EF_PostScript;
else exFormat = Graphic3d_EF_EnhPostScript;
- myView->View()->Export( theFile, exFormat );
+ myView->View()->Export( aFileName, exFormat );
return;
}
- Handle(Aspect_Window) anAspectWindow = myView->Window();
- Handle(WNT_Window) aWNTWindow = Handle(WNT_Window)::DownCast(anAspectWindow);
- if (ext == "bmp") aWNTWindow->SetOutputFormat ( WNT_TOI_BMP );
- if (ext == "gif") aWNTWindow->SetOutputFormat ( WNT_TOI_GIF );
- if (ext == "xwd") aWNTWindow->SetOutputFormat ( WNT_TOI_XWD );
- aWNTWindow->Dump ((Standard_CString)(LPCTSTR)filename);
- SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
+ myView->Dump(aFileName);
}
}
struct FIBITMAP;
//! Image class that support file reading/writing operations using auxiliary image library.
-//! Notice that supported images format could be limited.
+//! Supported image formats:
+//! - *.bmp - bitmap image, lossless format without compression.
+//! - *.ppm - PPM (Portable Pixmap Format), lossless format without compression.
+//! - *.png - PNG (Portable Network Graphics) lossless format with compression.
+//! - *.jpg, *.jpe, *.jpeg - JPEG/JIFF (Joint Photographic Experts Group) lossy format (compressed with quality losses). YUV color space used (automatically converted from/to RGB).
+//! - *.tif, *.tiff - TIFF (Tagged Image File Format).
+//! - *.tga - TGA (Truevision Targa Graphic), lossless format.
+//! - *.gif - GIF (Graphical Interchange Format), lossy format. Color stored using pallete (up to 256 distinct colors).
+//! - *.exr - OpenEXR high dynamic-range format (supports float pixel formats).
class Image_AlienPixMap : public Image_PixMap
{