J2KCompressionControl example for Visual Basic

Private Sub TestProcBitmap()
LEADDICOM1.InitDS DICOM_CLASS_CR_IMAGE_STORAGE, DS_EXPLICIT_VR + _
DS_METAHEADER_ABSENT + DS_LITTLE_ENDIAN
'insert the image into the element
LEADDICOM1.Bitmap = LEADRasterView1.Raster.Bitmap
    
' Use the Q factor for compression control.
LEADDICOM1.J2KOptions.J2KCompressionControl= DICOM_J2K_COMP_QFACTOR
    
'set the bitmap
LEADDICOM1.SetBitmapValue DICOM_IMAGE_COMPRESSION_J2K_LOSSY, _
DICOM_IMAGE_PHOTOMETRIC_MONOCHROME2, 0, 100, 0
End Sub