GetBitmapCount Example for VB.NET
'LEADDICOM1 is a DICOM Dataset defined outside this method 
 
'This example uses the predefined variable "LEADRasterView1" 
 of type "AxLEADRasterView" from "LEADTOOLS Toolkit". 
 
Private Sub TestGetBitmapCount() 
   Dim lCount As Integer
   lCount = LEADDICOM1.GetBitmapCount 
   If (lCount = 1) Then 
      'get the bitmap 
      LEADDICOM1.GetBitmapValue(0, 0, LTDICLib.DicomColorOrderConstants.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, LTDICLib.DicomColorOrderConstants.ORDER_RGB, 0) 
      LEADRasterView1.Raster.BitmapList = LEADDICOM1.BitmapList 
      MessageBox.Show("There are " & CStr(LEADDICOM1.BitmapListCount) & " Images") 
      LEADDICOM1.BitmapList = 0 'free the image 
      'play the animation 
      LEADRasterView1.AnimationLoop = True 
      LEADRasterView1.AnimationEnable = True 
   Else 
      MessageBox.Show("No Image!") 
   End If 
      MessageBox.Show("wait")
End Sub