SaveJBIG2SaveFlags Example for Delphi

procedure TForm1.Button1Click(Sender: TObject);
var
   nRet: Integer; 
begin
   LEADDlgFile1.DlgFlags:= LEADDlgFile1.DlgFlags + DLG_SAVE_SHOW_FILEOPTIONS_JBIG2OPTIONS; 

   nRet:= LEADDlgFile1.ShowSaveDlg (Self); 
   if(nRet = SUCCESS_DLG_OK)then
   begin
      LEADImage1.JBIG2SaveFlags := LEADDlgFile1.SaveJBIG2SaveFlags
      LEADImage1.JBIG2TemplateType := LEADDlgFile1.SaveJBIG2TemplateType
      LEADImage1.JBIG2GBATX1 := LEADDlgFile1.SaveJBIG2GBATX1
      LEADImage1.JBIG2GBATY1 := LEADDlgFile1.SaveJBIG2GBATY1
      LEADImage1.JBIG2GBATX2: = LEADDlgFile1.SaveJBIG2GBATX2
      LEADImage1.JBIG2GBATY2 := LEADDlgFile1.SaveJBIG2GBATY2
      LEADImage1.JBIG2GBATX3 := LEADDlgFile1.SaveJBIG2GBATX3
      LEADImage1.JBIG2GBATY3 := LEADDlgFile1.SaveJBIG2GBATY3
      LEADImage1.JBIG2GBATX4 := LEADDlgFile1.SaveJBIG2GBATX4
      LEADImage1.JBIG2GBATY4 := LEADDlgFile1.SaveJBIG2GBATY4
      
      LEADImage1.Save(LEADDlgFile1.FileName
                      LEADDlgFile1.SaveFormat
                      LEADDlgFile1.SaveBitsPerPixel
                      LEADDlgFile1.SaveQFactor
                      LEADDlgFile1.SaveMulti); 
   end; 
end;