ImgAddOr

Top  Previous  Next

Prototype

 

ImgAddOr (intDestinationImageHandle,intSourceImageHandle)

 

Description

 

Copies the source image into destination image, overwriting its preceding content and applying logical "OR" operation on between each bit of source and of destination. Source and destination handles must refers to images that have the same size and same bits per pixel.

 

Parameters

 

intDestinationImageHandle: integer value corresponding to the destination image handle.

 

intSourceImageHandle: integer value corresponding to the source image handle.

 

Returned value

 

None.

 

Example

 

// =============================================

// This example add a mask to a monochrome image

// =============================================

 

// Open an existing mask from disk

MaskImage:= ImgOpen('c:\images\mask.tif')

 

// Scale the mask according to current image size

ImgScale(MaskImage, ImgGetWidth(_CurrentImage), ImgGetHeight(_CurrentImage), false);

 

// If template black color is not "1" then the mask is inverted

if ImgGetBlackValue(MaskImage)=0 then ImgInvert(MaskImage);

 

// If image black color is not "1" then the image is inverted

ImageInverted:=False;

if ImgGetBlackValue(_CurrentImage)=0 then

begin

 ImgInvert(_CurrentImage);

 ImageInverted:=True;

end;

 

// Add on current image the mask using logical "OR" operation

ImgAddOr(_CurrentImage, MaskImage);

 

// Delete the mask

ImgDelete(MaskImage);

 

// Re-invert the image is previously inverted

if ImageInverted then ImgInvert(_CurrentImage);