ImgSaveAsBmp
Previous  Top  Next

Prototype

boolSaved:=ImgSaveAsBmp(intImageHandle, FileName)

Description

It saves an image in BMP format.

Parameters

intImageHandle: integer value corresponding to the image handle.

FileName: path and name of the file where the image is saved.

Returned value

boolSaved: boolean value that specifies if saving operation was correctly executed.

Notes

None.

Example

// Test if image is monochrome
nBits:=ImgGetBitsPixel(_CurrentImage);
//if it's not monochrome then
if nBits>1 then
 begin
  // make a copy of full image
  BinaryImage:=ImgCopy(_CurrentImage,0,0,0,0);
  // threshold the image
  ImgThreshold(BinaryImage,127);
  // Save image whith same original name and type but in \Mono sub directory
  NewFileName:=ExtractFilePath(_CurrentOutputFile)+'\Mono'+ExtractFileName(_CurrentOutputFile);
  tipo:=ExtractFileExt(_CurrentOutputFile);
  if tipo='.tif' then ImgSaveAsTif(BinaryImage,NewFileName)
   else if tipo='.jpg' then ImgSaveAsJpg(BinaryImage,NewFileName)
    else if tipo='.png' then ImgSaveAsPng(BinaryImage,NewFileName)
     else if tipo='.bmp' then ImgSaveAsBmp(BinaryImage,NewFileName)
      else if tipo='.pdf' then ImgSaveAsPdf(BinaryImage,NewFileName)
       else ApplicationLog(_CurrentAgent,'Error: '+tipo+' format not supported in output.');
  //delete image from memory
  ImgDelete(BinaryImage);
 end;