JBIG2GBATX1 Example for Visual Basic
Dim nRet As Integer
Dim RasterIO As New LEADRasterIO
Dim RasterFileDlg As New LEADRasterDlgFile
Dim RasterKrn As New LEADRasterDlgKrn
LEADRasterView1.Raster.UnlockSupport L_SUPPORT_JBIG2,
L_KEY_JBIG2
RasterKrn.InitDlg 0
RasterIO.Load LEADRasterView1.Raster, "c:\parrots.jpg",
0, 0, 1
RasterFileDlg.DialogTitle = "Save a File"
RasterFileDlg.FileDlgFlags = 0
RasterFileDlg.InitialDir = "C:\"
RasterFileDlg.SaveMulti = MULTIPAGE_OVERWRITE
RasterFileDlg.UIFlags = SAVE_AUTOPROCESS Or _
SAVE_SHOW_FILEOPTIONS_PROGRESSIVE
Or _
SAVE_SHOW_FILEOPTIONS_MULTIPAGE
Or _
SAVE_SHOW_FILEOPTIONS_STAMP
Or _
SAVE_SHOW_FILEOPTIONS_QFACTOR
Or _
SAVE_SHOW_FILEOPTIONS_J2KOPTIONS
Or _
SAVE_SHOW_FILEOPTIONS_BASICJ2KOPTIONS
Or _
SAVE_SHOW_FILEOPTIONS_JBIG2OPTIONS
RasterFileDlg.Bitmap = LEADRasterView1.Raster.Bitmap
nRet = RasterFileDlg.ShowSaveDlg(hWnd)
If (nRet = 0 And RasterFileDlg.DialogStatus = DLG_OK)
Then
If (RasterFileDlg.SaveFormat = FILE_JBIG2
Or _
RasterFileDlg.SaveFormat
= FILE_RAS_PDF_JBIG2 Or _
RasterFileDlg.SaveFormat
= FILE_TIF_JBIG2) Then
RasterIO.JBIG2ImageGBATX1
= RasterFileDlg.JBIG2ImageGBATX1
RasterIO.JBIG2ImageGBATY1
= RasterFileDlg.JBIG2ImageGBATY1
RasterIO.JBIG2ImageGBATX2
= RasterFileDlg.JBIG2ImageGBATX2
RasterIO.JBIG2ImageGBATY2
= RasterFileDlg.JBIG2ImageGBATY2
RasterIO.JBIG2ImageGBATX3
= RasterFileDlg.JBIG2ImageGBATX3
RasterIO.JBIG2ImageGBATY3
= RasterFileDlg.JBIG2ImageGBATY3
RasterIO.JBIG2ImageGBATX4
= RasterFileDlg.JBIG2ImageGBATX4
RasterIO.JBIG2ImageGBATY4
= RasterFileDlg.JBIG2ImageGBATY4
RasterIO.JBIG2ImageTemplateType
= RasterFileDlg.JBIG2ImageTemplateType
RasterIO.JBIG2ImageFlags
= RasterFileDlg.JBIG2ImageFlags
RasterIO.JBIG2ImageQFactor
= RasterFileDlg.JBIG2ImageQFactor
RasterIO.JBIG2TextGBATX1
= RasterFileDlg.JBIG2TextGBATX1
RasterIO.JBIG2TextGBATY1
= RasterFileDlg.JBIG2TextGBATY1
RasterIO.JBIG2TextGBATX2
= RasterFileDlg.JBIG2TextGBATX2
RasterIO.JBIG2TextGBATY2
= RasterFileDlg.JBIG2TextGBATY2
RasterIO.JBIG2TextGBATX3
= RasterFileDlg.JBIG2TextGBATX3
RasterIO.JBIG2TextGBATY3
= RasterFileDlg.JBIG2TextGBATY3
RasterIO.JBIG2TextGBATX4
= RasterFileDlg.JBIG2TextGBATX4
RasterIO.JBIG2TextGBATY4
= RasterFileDlg.JBIG2TextGBATY4
RasterIO.JBIG2TextTemplateType
= RasterFileDlg.JBIG2TextTemplateType
RasterIO.JBIG2TextFlags
= RasterFileDlg.JBIG2TextFlags
RasterIO.JBIG2TextQFactor
= RasterFileDlg.JBIG2TextQFactor
RasterIO.JBIG2TextMinSymArea
= RasterFileDlg.JBIG2TextMinSymArea
RasterIO.JBIG2TextMinSymWidth
= RasterFileDlg.JBIG2TextMinSymWidth
RasterIO.JBIG2TextMinSymHeight
= RasterFileDlg.JBIG2TextMinSymHeight
RasterIO.JBIG2TextMaxSymArea
= RasterFileDlg.JBIG2TextMaxSymArea
RasterIO.JBIG2TextMaxSymWidth
= RasterFileDlg.JBIG2TextMaxSymWidth
RasterIO.JBIG2TextMaxSymHeight
= RasterFileDlg.JBIG2TextMaxSymHeight
RasterIO.JBIG2TextDifThreshold
= RasterFileDlg.JBIG2TextDifThreshold
RasterIO.JBIG2YResolution
= RasterFileDlg.JBIG2YResolution
RasterIO.JBIG2XResolution
= RasterFileDlg.JBIG2XResolution
RasterIO.JBIG2Flags
= RasterFileDlg.JBIG2Flags
RasterIO.Save LEADRasterView1.Raster,
RasterFileDlg.FileName, RasterFileDlg.SaveFormat, 1, QFACTOR_LEAD_0, 0
End If
End If
RasterKrn.FreeDlg