GetBitmapCount Example for Delphi
var
uCount: Cardinal;
begin
{ move to the first image element }
LEADDicom1.FindFirstElement(TAG_PIXEL_DATA, false);
uCount := LEADDicom1.GetBitmapCount();
If uCount = 1 Then
begin
{ get the bitmap }
LEADDicom1.GetBitmapValue(0, 0, ORDER_RGB);
LEADImage1.Bitmap := LEADDicom1.Bitmap;
LEADDicom1.Bitmap := 0; { free the image }
end
else If uCount > 1 Then
begin
{ get the bitmap list }
LEADDicom1.GetBitmapListValue(0, uCount, 0, ORDER_RGB);
LEADImage1.BitmapList := LEADDicom1.BitmapList;
ShowMessage('There are ' + IntToStr(LEADDicom1.BitmapListCount) + ' Images');
LEADDicom1.BitmapList := 0; { free the image }
{ play the animation }
LEADImage1.AnimationLoop := true;
LEADImage1.AnimationEnable
:= true;
end
else
ShowMessage('No Image!');
ShowMessage('wait');
LEADImage1.AnimationEnable := false;
end;