J2KROIControl example for C++ 5.0 and later
m_pRasterIO->J2KSetDefaults ();
// Set our options
m_pRasterIO->J2KCompressionRatio = 1000;
m_pRasterIO->J2KCompressionControl = J2K_COMP_RATIO;
m_pRasterIO->J2KUseROI = TRUE;
m_pRasterIO->J2KROIControl = J2K_USEOPTION_RECT;
m_pRasterIO->J2KROILeft = 200;
m_pRasterIO->J2KROITop = 200;
m_pRasterIO->J2KROIWidth = 600;
m_pRasterIO->J2KROIHeight = 600;
m_pRasterIO->J2KXTsiz = 100;
m_pRasterIO->J2KYTsiz = 100;
// Save the bitmap to disk
m_pRasterIO->Save (m_LEADRasterView.GetRaster(), "c:\\image1.j2k", FILE_J2K, 24, (QFactorConstants)2, SAVE_OVERWRITE);