GetBitmapCount Example for Visual Basic

Private Sub TestFunc()
    Dim lCount As Long
            
    lCount = LEADDICOM1.GetBitmapCount
    If (lCount = 1) Then
        'get the bitmap
        LEADDICOM1.GetBitmapValue 0, 0, ORDER_RGB, 0
        LEADRasterView1.Raster.Bitmap = LEADDICOM1.Bitmap
        LEADDICOM1.Bitmap = 0 'free the image
    ElseIf (lCount > 1) Then
        'get the bitmap list
        LEADDICOM1.GetBitmapListValue 0, lCount, 0, ORDER_RGB, 0
        LEADRasterView1.Raster.BitmapList = LEADDICOM1.BitmapList
        MsgBox "There are " & CStr(LEADDICOM1.BitmapList Count) & " Images"
        LEADDICOM1.BitmapList = 0 'free the image
        'play the animation
        LEADRasterView1.AnimationLoop = True
        LEADRasterView1.AnimationEnable = True
    Else
        MsgBox "No Image!"
    End If
    MsgBox "wait"
End Sub