DeleteBitmapValue Example for Delphi

Procedure TForm1.TestProcReplaceBitmap();
var
   nRet: Integer;
   Process: LEADRasterProcess;
begin
   Process:= CreateComObject(CLASS_LEADRasterProcess) as LEADRasterProcess;
   LEADDicomDS1.EnableMethodErrors:= False;
   //move to the first image element
   nRet:= LEADDicomDS1.FindFirstElement (TAG_PIXEL_DATA, False);
   //get the first image
   nRet:= LEADDicomDS1.GetBitmapValue (0, 0, ORDER_BGR, 0);
   LEADRasterView1.Raster.Bitmap:= LEADDicomDS1.Bitmap;
   //flip the image
   Process.Flip(LEADRasterView1.Raster);

   //delete the first image from the dataset
   nRet:= LEADDicomDS1.DeleteBitmapValue(0, 1);

   //now update the list with the flipped image
   nRet:= LEADDicomDS1.InsertBitmapValue (LEADRasterView1.Raster.Bitmap, 0, DICOM_IMAGE_COMPRESSION_NONE, DICOM_IMAGE_PHOTOMETRIC_RGB, 0, 0, 0);
end;