FileFormatsCount example for Delphi
procedure TForm1.ShowSaveDlg3Click(Sender: TObject);
begin
LEADDlgFile1.DialogTitle:= 'Save a File';
LEADDlgFile1.MaxFileSize:= 0;
LEADDlgFile1.MaxFileTitleSize:= 0;
LEADDlgFile1.DlgFileFlags:= 0;
LEADDlgFile1.InitialDir:= 'C:\';
LEADDlgFile1.FileFormatsCount:= 2;
LEADDlgFile1.FileFormats [0].Format:= DLG_FF_SAVE_LEAD;
LEADDlgFile1.FileFormats [0].BppCount:= 1;
LEADDlgFile1.FileFormats [0].FormatBpp [0]:= 24;
LEADDlgFile1.FileFormats [0].SubFormats [0]:= DLG_FF_SAVE_SUB_CMP_NONPROGRESSIVE + DLG_FF_SAVE_SUB_CMP_PROGRESSIVE;
LEADDlgFile1.FileFormats [1].Format:= DLG_FF_SAVE_TIFF;
LEADDlgFile1.FileFormats [1].BppCount:= 1;
LEADDlgFile1.FileFormats [1].FormatBpp [0]:= 24;
LEADDlgFile1.FileFormats [1].SubFormats [0]:= DLG_FF_SAVE_SUB_TIFF1_CCITT + DLG_FF_SAVE_SUB_TIFF1_CCITT_G3_1D +
DLG_FF_SAVE_SUB_TIFF1_CCITT_G3_2D + DLG_FF_SAVE_SUB_TIFF1_CCITT_G4 +
DLG_FF_SAVE_SUB_TIFF1_UNCOMPRESSEDRGB + DLG_FF_SAVE_SUB_TIFF1_RLERGB +
DLG_FF_SAVE_SUB_TIFF1_LZWRGB + DLG_FF_SAVE_SUB_TIFF1_JBIG;
LEADDlgFile1.SaveFileTypeIndex:= DLG_FF_SAVE_LEAD;
LEADDlgFile1.SaveSubTypeIndex:= DLG_FF_SAVE_SUB_CMP_PROGRESSIVE;
LEADDlgFile1.DlgFlags:= DLG_SAVE_AUTOPROCESS +
DLG_SAVE_SHOW_FILEOPTIONS_PROGRESSIVE +
DLG_SAVE_SHOW_FILEOPTIONS_MULTIPAGE +
DLG_SAVE_SHOW_FILEOPTIONS_STAMP +
DLG_SAVE_SHOW_FILEOPTIONS_QFACTOR +
DLG_SAVE_SHOW_FILEOPTIONS_J2KOPTIONS +
DLG_SAVE_SHOW_FILEOPTIONS_BASICJ2KOPTIONS;
LEADDlgFile1.LEADImage:= LEADImage1;
LEADDlgFile1.ShowSaveDlg ( Self );
end;