OptionsFileType example for C++ Builder
void __fastcall TForm1::ShowOpenDlg2Click(TObject *Sender)
{
L_INT i;
L_INT nRet;
LEADDlgFile1->DialogTitle = "LEADTOOLS Open dialog box";
LEADDlgFile1->InitialDir = "c:\\images";
LEADDlgFile1->DlgFileFlags = 0;
LEADDlgFile1->PreviewEnabled = true;
LEADDlgFile1->ShowLoadOptions = true;
LEADDlgFile1->LoadRotated = false;
LEADDlgFile1->LoadCompressed = false;
LEADDlgFile1->LoadPasses = 0;
LEADDlgFile1->MaxFileSize = 0;
LEADDlgFile1->MaxFileTitleSize = 0;
LEADDlgFile1->DlgFlags = DLG_OPEN_SHOW_PROGRESSIVE |
DLG_OPEN_SHOW_MULTIPAGE |
DLG_OPEN_SHOW_LOADROTATED |
DLG_OPEN_SHOW_LOADCOMPRESSED |
DLG_OPEN_SHOW_FILEINFO |
DLG_OPEN_SHOW_PREVIEW |
DLG_OPEN_SHOW_DELPAGE |
DLG_OPEN_SHOW_PDFOPTIONS |
DLG_OPEN_SHOW_RASTEROPTIONS |
DLG_OPEN_SHOW_VECTOROPTIONS |
DLG_OPEN_SHOW_LOADOPTIONS |
DLG_OPEN_VIEWTOTALPAGES |
DLG_OPEN_LOADBITMAP |
DLG_OPEN_GENERATETHUMBNAIL;
LEADDlgFile1->LEADImage = LEADImage1;
nRet= LEADDlgFile1->ShowOpenDlg ( this );
if ( nRet == SUCCESS_DLG_OK )
{
switch ( LEADDlgFile1->OptionsFileType )
{
case FILE_PCD:
{
Edit1->Text= IntToStr ( LEADDlgFile1->PCDResolution );
}
break;
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:
{
Edit1->Text= IntToStr ( LEADDlgFile1->PDFXResolution );
Edit2->Text= IntToStr ( LEADDlgFile1->PDFYResolution );
Edit3->Text= IntToStr ( LEADDlgFile1->PDFDisplayDepth );
Edit4->Text= IntToStr ( LEADDlgFile1->PDFTextAlpha );
Edit5->Text= IntToStr ( LEADDlgFile1->PDFGraphicsAlpha );
}
break;
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:
{
Edit1->Text= IntToStr ( LEADDlgFile1->RASTERMISCXResolution );
Edit2->Text= IntToStr ( LEADDlgFile1->RASTERMISCYResolution );
}
break;
case FILE_WMF:
case FILE_EMF:
{
Edit1->Text= IntToStr ( LEADDlgFile1->METAFILEXResolution );
Edit2->Text= IntToStr ( LEADDlgFile1->METAFILEYResolution );
}
break;
case FILE_DWF:
case FILE_CGM:
case FILE_CMX:
case FILE_PCL:
case FILE_VECTOR_DUMP:
case FILE_PCT:
case FILE_DRW:
case FILE_INTERGRAPH_VECTOR:
case FILE_GERBER:
case FILE_SHP:
case FILE_SVG:
case FILE_VWPG:
{
Edit1->Text= IntToStr ( LEADDlgFile1->VECTORMISCViewportWidth );
Edit2->Text= IntToStr ( LEADDlgFile1->VECTORMISCViewportHeight );
Edit3->Text= IntToStr ( LEADDlgFile1->VECTORMISCViewportMode );
Edit4->Text= LEADDlgFile1->VECTORMISCFont;
}
break;
case FILE_DXF:
case FILE_DXF_R13:
case FILE_DWG:
{
Edit1->Text= IntToStr ( LEADDlgFile1->DXFViewportWidth );
Edit2->Text= IntToStr ( LEADDlgFile1->DXFViewportHeight );
Edit3->Text= IntToStr ( LEADDlgFile1->DXFViewportMode );
Edit4->Text= LEADDlgFile1->DXFFont;
Edit5->Text= IntToStr ( LEADDlgFile1->DXFAutoCADColorScheme );
}
break;
case FILE_PLT:
{
Edit1->Text= IntToStr ( LEADDlgFile1->PLTViewportWidth );
Edit2->Text= IntToStr ( LEADDlgFile1->PLTViewportHeight );
Edit3->Text= IntToStr ( LEADDlgFile1->PLTViewportMode );
Edit4->Text= LEADDlgFile1->PLTFont;
Edit5->Text= "[ " + IntToStr ( LEADDlgFile1->PLTPenWidth [0] );
Edit6->Text= "[ " + IntToStr ( LEADDlgFile1->PLTPenColor [0] );
for ( i= 1; i < 8; i ++ )
{
Edit5->Text= Edit5->Text + ", " + IntToStr ( LEADDlgFile1->PLTPenWidth [i] );
Edit6->Text= Edit6->Text + ", " + IntToStr ( LEADDlgFile1->PLTPenColor [i] );
}
Edit5->Text= Edit5->Text + " ]";
Edit6->Text= Edit6->Text + " ]";
}
break;
default:
{
Edit1->Text= "None";
}
break;
}
}
}