ImgGetBlackValue
Previous  Top  Next

Prototype

IntColor:=ImgGetBlackValue(intImageHandle)

Description

It returns the code corresponding to the black colour for the shown image. It's useful in monochrome image for understanding if black code is '1' or '0'.


Parameters

intImageHandle: integer value corresponding to the image handle.

Returned value

IntColor: integer value showing the black colour of the image.

Notes

None.

Example

// transforming image to monochrome format
nBits:=ImgGetBitsPixel(_CurrentImage);
if nBits>1 then ImgThreshold(_CurrentImage,127);

//extracting width and height
width:=ImgGetWidth(_CurrentImage);
height:=ImgGetHeight(_CurrentImage);
//value for black color
color:=ImgGetBlackValue(_CurrentImage);

// printing a black border around current image
for x:=0 to width-1 do
   begin
      ImgSetPixel(_CurrentImage,x,0,color);
         ImgSetPixel(_CurrentImage,x,height-1,color);
    end;
for y:=0 to height-1 do
   begin
      ImgSetPixel(_CurrentImage,0,y,color);
      ImgSetPixel(_CurrentImage,width-1,y,color);
   end;
ApplicationLog(_CurrentAgent,'Drawing');