J2KTargetFileSize Example for Delphi

   LEADDicomDS1.InitDS (DICOM_CLASS_CR_IMAGE_STORAGE,
                       DS_EXPLICIT_VR + DS_METAHEADER_ABSENT + DS_LITTLE_ENDIAN);
   //insert the image into the element
   LEADDicomDS1.Bitmap:= LEADRasterView1.Raster.Bitmap;
   // Use the Compression ratio
   LEADDicomDS1.J2KOptions.J2KCompressionControl:= DICOM_J2K_COMP_TARGETSIZE;
   LEADDicomDS1.J2KOptions.J2KTargetFileSize:= 15 * 1024;
   //set the bitmap
   LEADDicomDS1.SetBitmapValue (DICOM_IMAGE_COMPRESSION_J2K_LOSSY,
                               DICOM_IMAGE_PHOTOMETRIC_MONOCHROME2,
                               0,
                               0,
                               0);