OptionsFileType Example for C++ 5.0 and later
void CDialogs::OnFiledialogsOptiontype()
{
int nRet;
UpdateData(true);
m_pRasterFileDlg->PutDialogTitle("LEADTOOLS Open dialog box");
m_pRasterFileDlg->InitialDir = "c:\\images";
m_pRasterFileDlg->FileDlgFlags = 0;
m_pRasterFileDlg->EnableShowPreview= true;
m_pRasterFileDlg->EnableShowLoadOptions= true;
m_pRasterFileDlg->LoadRotated= false;
m_pRasterFileDlg->LoadCompressed= false;
m_pRasterFileDlg->LoadPasses= 0;
m_pRasterFileDlg->UIFlags = OPEN_SHOW_PROGRESSIVE |
OPEN_SHOW_MULTIPAGE |
OPEN_SHOW_LOADROTATED |
OPEN_SHOW_LOADCOMPRESSED |
OPEN_SHOW_FILEINFO |
OPEN_SHOW_PREVIEW |
OPEN_SHOW_DELPAGE |
OPEN_SHOW_PDFOPTIONS |
OPEN_SHOW_RASTEROPTIONS |
OPEN_SHOW_VECTOROPTIONS |
OPEN_SHOW_LOADOPTIONS |
OPEN_VIEWTOTALPAGES |
OPEN_LOADBITMAP |
OPEN_GENERATETHUMBNAIL;
m_pRasterFileDlg->Bitmap= m_LeadRasterView.GetRaster ().GetBitmap ();
nRet = m_pRasterFileDlg->ShowOpenDlg((long)this->m_hWnd);
if (nRet == 0 && m_pRasterFileDlg->DialogStatus== DLG_OK)
{
switch(m_pRasterFileDlg->GetOptionsFileType())
{
case FILE_PCD:
m_Edit1.Format(TEXT("%d"),m_pRasterFileDlg->PCDResolution);
case FILE_RAS_PDF:
case FILE_RAS_PDF_G3_1D:
case FILE_RAS_PDF_G3_2D:
case FILE_RAS_PDF_G4 :
case FILE_RAS_PDF_JPEG:
case FILE_RAS_PDF_JPEG_422:
case FILE_RAS_PDF_JPEG_411:
m_Edit1.Format(TEXT("%d"),m_pRasterFileDlg->PDFXResolution);
m_Edit2.Format(TEXT("%d"),m_pRasterFileDlg->PDFYResolution);
m_Edit3.Format(TEXT("%d"),m_pRasterFileDlg->PDFDisplayDepth);
m_Edit4.Format(TEXT("%d"),m_pRasterFileDlg->PDFTextAlpha);
m_Edit5.Format(TEXT("%d"),m_pRasterFileDlg->PDFGraphicsAlpha);
case FILE_FPX:
case FILE_FPX_SINGLE_COLOR:
case FILE_FPX_JPEG:
case FILE_FPX_JPEG_QFACTOR:
case FILE_CMW:
case FILE_JBIG:
case FILE_JP2:
case FILE_J2K:
m_Edit1.Format(TEXT("%d"),m_pRasterFileDlg->RasterXResolution);
m_Edit2.Format(TEXT("%d"),m_pRasterFileDlg->RasterYResolution);
case FILE_WMF:
case FILE_EMF:
m_Edit1.Format(TEXT("%d"),m_pRasterFileDlg->WMFXResolution);
m_Edit2.Format(TEXT("%d"),m_pRasterFileDlg->WMFYResolution);
case FILE_DWF:
case FILE_CGM:
case FILE_VECTOR_DUMP:
case FILE_DRW:
case FILE_INTERGRAPH_VECTOR:
case FILE_GERBER:
m_Edit1.Format(TEXT("%d"),m_pRasterFileDlg->VectorViewportWidth);
m_Edit2.Format(TEXT("%d"),m_pRasterFileDlg->VectorViewportHeight);
m_Edit3.Format(TEXT("%d"),m_pRasterFileDlg->VectorViewportMode);
m_Edit4.Format(TEXT("%d"),m_pRasterFileDlg->VectorFont);
case FILE_DXF:
case FILE_DWG:
m_Edit1.Format(TEXT("%d"),m_pRasterFileDlg->DXFViewportWidth);
m_Edit2.Format(TEXT("%d"),m_pRasterFileDlg->DXFViewportHeight);
m_Edit3.Format(TEXT("%d"),m_pRasterFileDlg->DXFViewportMode);
m_Edit4.Format(TEXT("%d"),m_pRasterFileDlg->DXFFont);
m_Edit5.Format(TEXT("%d"),m_pRasterFileDlg->DXFAutoCADColorScheme);
case FILE_PLT:
m_Edit1.Format(TEXT("%d"),m_pRasterFileDlg->PLTViewportWidth);
m_Edit2.Format(TEXT("%d"),m_pRasterFileDlg->PLTViewportHeight);
m_Edit3.Format(TEXT("%d"),m_pRasterFileDlg->PLTViewportMode);
m_Edit4.Format(TEXT("%d"),m_pRasterFileDlg->PLTFont);
}
for(int i = 0;i< 7 ;++i)
{
m_Edit1.Format(TEXT("[%d]"),m_pRasterFileDlg->GetPLTPenWidth(i));
m_Edit1.Format(TEXT("[%d]"),m_pRasterFileDlg->GetPLTPenColor(i));
}
}
UpdateData(false);
}