GetBitmapCount Example for C#

//This example uses the predefined variable “LEADRasterView1” of type “AxLEADRasterView” from “"LEADTOOLS Toolkit”.
//LEADDICOM1 is a DICOM Dataset defined outside this method
private void TestGetBitmapCount()
{
   int lCount = 0;
   lCount = LEADDICOM1.GetBitmapCount();
   if (lCount == 1)
   {
      //get the bitmap
      LEADDICOM1.GetBitmapValue(0, 0, (short) LTDICLib.DicomColorOrderConstants.ORDER_RGB, 0);
      LEADRasterView1.Raster.Bitmap = LEADDICOM1.Bitmap;
      LEADDICOM1.Bitmap = 0;
      //free the image
   }
   else
      if (lCount > 1)
      {
         //get the bitmap list
         LEADDICOM1.GetBitmapListValue(0, lCount, 0, (short)LTDICLib.DicomColorOrderConstants.ORDER_RGB, 0);
         LEADRasterView1.Raster.BitmapList = LEADDICOM1.BitmapList;
         MessageBox.Show("There are " + System.Convert.ToString(LEADDICOM1.BitmapListCount) + " Images");
         LEADDICOM1.BitmapList = 0;
         //free the image
         //play the animation
         LEADRasterView1.AnimationLoop = true;
         LEADRasterView1.AnimationEnable = true;
   }
   else
      MessageBox.Show("No Image!");
      MessageBox.Show("wait");
}