JBIG2ImageGBATX1 Example for C++ 5.0 and later

ILEADRasterIO * pRasterIO = NULL; 

CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);  

 

m_RasterView.GetRaster().UnlockSupport(L_SUPPORT_JBIG2, L_KEY_JBIG2); 

pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\1.jpg"), 0, 0, 1); 

 

pRasterIO->JBIG2ImageGBATX1 = 3; 

pRasterIO->JBIG2ImageGBATY1 = -1; 

pRasterIO->JBIG2ImageGBATX2 = 3; 

pRasterIO->JBIG2ImageGBATY2 = -1; 

pRasterIO->JBIG2ImageGBATX3 = 2; 

pRasterIO->JBIG2ImageGBATY3 = -2; 

pRasterIO->JBIG2ImageGBATX4 = -2; 

pRasterIO->JBIG2ImageGBATY4 = -2; 

pRasterIO->JBIG2ImageTemplateType = 0; 

pRasterIO->JBIG2ImageFlags = 0; 

pRasterIO->JBIG2ImageQFactor = 0; 

 

pRasterIO->JBIG2TextGBATX1 = 3; 

pRasterIO->JBIG2TextGBATY1 = -1; 

pRasterIO->JBIG2TextGBATX2 =3; 

pRasterIO->JBIG2TextGBATY2 =-1; 

pRasterIO->JBIG2TextGBATX3 =2; 

pRasterIO->JBIG2TextGBATY3 =-2; 

pRasterIO->JBIG2TextGBATX4 =-2; 

pRasterIO->JBIG2TextGBATY4 =-2; 

pRasterIO->JBIG2TextTemplateType = 0; 

pRasterIO->JBIG2TextFlags = JBIG2_TEXT_KEEPALLSYM; 

pRasterIO->JBIG2TextQFactor = 0; 

pRasterIO->JBIG2TextMinSymArea = 50; 

pRasterIO->JBIG2TextMinSymWidth = 1; 

pRasterIO->JBIG2TextMinSymHeight = 1; 

pRasterIO->JBIG2TextMaxSymArea = 2000; 

pRasterIO->JBIG2TextMaxSymWidth = 200; 

pRasterIO->JBIG2TextMaxSymHeight = 200; 

pRasterIO->JBIG2TextDifThreshold = 10; 

 

pRasterIO->JBIG2YResolution = 150; 

pRasterIO->JBIG2XResolution = 150; 

pRasterIO->JBIG2Flags = JBIG2_ENABLE_DICTIONARY; 

 

pRasterIO->Save (m_RasterView.GetRaster(), TEXT("c:\\1.jb2"), (RasterFileConstants)FILE_JBIG, 1, QFACTOR_LEAD_0, 0); 

 

if(pRasterIO) 

   pRasterIO->Release();