InsertBitmapValue Example for Delphi
var
uCount: Cardinal;
nRet: Integer;
begin
LEADDicom1.EnableMethodErrors := false;
{ move to the first image element and delete what's there }
LEADDicom1.FindFirstElement(TAG_PIXEL_DATA, false);
LEADDicom1.DeleteElement();
LEADDicom1.InsertElement(false, TAG_PIXEL_DATA, VR_OB, false, 0);
{ load an image }
LEADImage1.Load ('c:\lead\images\image1.cmp', 0, 1, 1);
ShowMessage('Image loaded from File - Wait');
uCount := LEADDicom1.GetBitmapCount();
{ insert some images }
nRet := LEADDicom1.InsertBitmapValue(LEADImage1.Bitmap, uCount, DICOM_IMAGE_COMPRESSION_NONE, DICOM_IMAGE_PHOTOMETRIC_RGB, 0, 0);
If nRet <> SUCCESS Then
begin
ShowMessage('Error Number: ' + IntToStr(LEADDicom1.Error));
exit;
end;
LEADImage1.Flip ();
nRet := LEADDicom1.InsertBitmapValue(LEADImage1.Bitmap, uCount + 1, DICOM_IMAGE_COMPRESSION_NONE, DICOM_IMAGE_PHOTOMETRIC_RGB, 0, 0);
If nRet <> SUCCESS Then
begin
ShowMessage('Error Number: ' + IntToStr(LEADDicom1.Error));
exit;
end;
LEADImage1.
Reverse ();
nRet := LEADDicom1.InsertBitmapValue(LEADImage1.Bitmap, uCount + 2, DICOM_IMAGE_COMPRESSION_NONE, DICOM_IMAGE_PHOTOMETRIC_RGB, 0, 0);
If nRet <> SUCCESS Then
begin
ShowMessage('Error Number: ' + IntToStr(LEADDicom1.Error));
exit;
end;
ShowMessage('Images inserted - Wait');
End;