J2KROIControl example for Visual Basic
Private Sub Command1_Click()
RasterIO.J2KSetDefaults
' Set our options
RasterIO.J2KCompressionRatio = 1000
RasterIO.J2KCompressionControl = J2K_COMP_RATIO
RasterIO.J2KUseROI = True
RasterIO.J2KROIControl = J2K_USEOPTION_RECT
RasterIO.J2KROILeft = 200
RasterIO.J2KROITop = 200
RasterIO.J2KROIWidth = 600
RasterIO.J2KROIHeight = 600
RasterIO.J2KXTsiz = 100
RasterIO.J2KYTsiz = 100
' Save the bitmap to disk
RasterIO.Save LEADRasterView1.Raster, "c:\image1.j2k", FILE_J2K, 24, 2, SAVE_OVERWRITE
End Sub