InsertBitmapValue Example for Visual Basic
Private Sub TestProcInsertBitmap()
Dim nRet As Integer
Dim IO As New LEADRasterIO
Dim Process As New LEADRasterProcess
LEADDICOM1.EnableMethodErrors = False
'move to the first image element and delete what's there
nRet = LEADDICOM1.FindFirstElement (TAG_PIXEL_DATA, False)
nRet = LEADDICOM1.DeleteElement()
nRet = LEADDICOM1.InsertElement (False, TAG_PIXEL_DATA, VR_OB, False, 0)
'load an image
IO.Load LEADRasterView1.Raster, "d:\lead14\dist\images\image1.cmp", 0, 1, 1
MsgBox "Image loaded from File - Wait"
lCount = LEADDICOM1.GetBitmapCount
'insert some images
nRet = LEADDICOM1.InsertBitmapValue (LEADRasterView1.Raster.Bitmap, lCount, DICOM_IMAGE_COMPRESSION_NONE, DICOM_IMAGE_PHOTOMETRIC_RGB, 0, 0, 0)
If (nRet <> 0) Then
MsgBox "Error"
Exit Sub
End If
Process.Flip LEADRasterView1.Raster
nRet = LEADDICOM1.InsertBitmapValue (LEADRasterView1.Raster.Bitmap, lCount + 1, DICOM_IMAGE_COMPRESSION_NONE, DICOM_IMAGE_PHOTOMETRIC_RGB, 0, 0, 0)
If (nRet <> 0) Then
MsgBox "Error"
Exit Sub
End If
Process.Reverse LEADRasterView1.Raster
nRet = LEADDICOM1.InsertBitmapValue (LEADRasterView1.Raster.Bitmap, lCount + 2, DICOM_IMAGE_COMPRESSION_NONE, DICOM_IMAGE_PHOTOMETRIC_RGB, 0, 0, 0)
If (nRet <> 0) Then
MsgBox "Error"
Exit Sub
End If
MsgBox "Images inserted - Wait"
End Sub