ImgMask

Top  Previous  Next

Prototype

 

ImgMask(IntDestHandleImage, intMask, intXOffset, intYOffset, intDestColor, intMaskColor)

 

Description

 

Mask an image using another ones. For each color pixel of intMaskColor in image intMask, the shifted pixel of intXOffset,intYOffest in intDest image is set to intDestColor .

 

Parameters

 

intDestHandleImage: integer value corresponding to image handle to mask.

intMask: integer value corresponding  to mask image handle.

intXOffset:integer value corresponding  to horizontal pixel shift.

intYOffset:integer value corresponding  to vertical pixel shift.

intDestColor: integer value corresponding  to color to use as destination image mask.

intMaskColor: integer value corresponding  to color used as mask in mask image.

 

Returned Value

 

None

 

Notes

 

Color codes are:

RGB (da $000000 a $FFFFFF): color image

Grayscale (da $00 a $FF): grayscale image

0 o 1: BW image.

 

Example

 

//Initialize and convert black color in RGB code.

BlackColor:=ImgRGB (0,0,0);

 

//Initialize and convert green color in RGB code.

GreenColor:=ImgRGB (75, 193, 47);

 

//open mask image

HandleMask:=ImgOpen('c:\immagini\Immagine.bmp',0);

 

//Execute masking.

ImgMask(_CurrentImage, HandleMask,500, 500,GreenColor, BlackColor);

 

//Deallocate memory

IMGDELETE(HandleMask);

 

//save image

ImgSave(_Currentimage,'c:\immagini\mask.tif');