Method SetMaskFromImage
SetMaskFromImage(GenericImage, RGBValue)
Sets image's mask so that the pixels that have RGB value of mr,mg,mb in mask will be masked in the image.
public virtual bool SetMaskFromImage(GenericImage image, RGBValue mask)
Parameters
image
GenericImageMask image to extract mask shape from. It must have the same dimensions as the image.
mask
RGBValueMask RGB color.
Returns
- bool
Returns
false
if mask does not have same dimensions as the image or if there is no unused color left. Returnstrue
if the mask was successfully applied.
Remarks
This is done by first finding an unused color in the image, setting this color as the mask color and then using this color to draw all pixels in the image who corresponding pixel in mask has given RGB value.