JBIG2Options example for Delphi

procedure TForm1.Button1Click(Sender: TObject);
begin
   LEADImage1.UnlockSupport (L_SUPPORT_JBIG2, L_KEY_JBIG2); 

   LEADImage1.Load ('c:\parrots.jpg', 0, 0, 1); 

   LEADImage1.JBIG2ImageGBATX1:= 3; 
   LEADImage1.JBIG2ImageGBATY1:= -1; 
   LEADImage1.JBIG2ImageGBATX2:= 3; 
   LEADImage1.JBIG2ImageGBATY2:= -1; 
   LEADImage1.JBIG2ImageGBATX3:= 2; 
   LEADImage1.JBIG2ImageGBATY3:= -2; 
   LEADImage1.JBIG2ImageGBATX4:= -2; 
   LEADImage1.JBIG2ImageGBATY4:= -2; 
   LEADImage1.JBIG2ImageTemplateType:= 0; 
   LEADImage1.JBIG2ImageFlags:= 0; 
   LEADImage1.JBIG2ImageQFactor:= 0; 
   LEADImage1.JBIG2TextGBATX1:= 3; 
   LEADImage1.JBIG2TextGBATY1:= -1; 
   LEADImage1.JBIG2TextGBATX2:= 3; 
   LEADImage1.JBIG2TextGBATY2:= -1; 
   LEADImage1.JBIG2TextGBATX3:= 2; 
   LEADImage1.JBIG2TextGBATY3:= -2; 
   LEADImage1.JBIG2TextGBATX4:= -2; 
   LEADImage1.JBIG2TextGBATY4:= -2; 
   LEADImage1.JBIG2TextTemplateType:= 0; 
   LEADImage1.JBIG2TextFlags:= JBIG2_TEXT_KEEPALLSYM; 
   LEADImage1.JBIG2TextQFactor:= 0; 
   LEADImage1.JBIG2TextMinSymArea:= 50; 
   LEADImage1.JBIG2TextMinSymWidth:= 1; 
   LEADImage1.JBIG2TextMinSymHeight:= 1; 
   LEADImage1.JBIG2TextMaxSymArea:= 2000; 
   LEADImage1.JBIG2TextMaxSymWidth:= 200; 
   LEADImage1.JBIG2TextMaxSymHeight:= 200; 
   LEADImage1.JBIG2TextDifThreshold:= 10; 
   LEADImage1.JBIG2YResolution:= 150; 
   LEADImage1.JBIG2XResolution:= 150; 
   LEADImage1.JBIG2Flags:= JBIG2_ENABLE_DICTIONARY; 

   LEADImage1.Save ('c:\1.jb2', FILE_JBIG2, 1, 0, 0);
end;