J2KUseROI example for C++ Builder
void __fastcall TForm1::btnSaveUsingROIClickClick(TObject *Sender)
{
// Set the default settings for the J2K
LEADImage1->J2KSetDefaults ( ) ;
// Set our options
LEADImage1->J2KCompressionRatio = 1000;
LEADImage1->J2KCompressionControl = J2K_COMPRESSION_RATIO;
LEADImage1->J2KUseROI= true;
LEADImage1->J2KROIControl = J2K_USE_OPTION_RECT;
LEADImage1->J2KROIRect= Rect ( 200, 200, 400, 400 );
LEADImage1->J2KXTsiz = 100;
LEADImage1->J2KYTsiz = 100;
// Save the bitmap to disk
LEADImage1->Save ( "c:\\image1.j2k", FILE_J2K, 24, 2, SAVE_OVERWRITE ) ;
}