Table of Contents

Method SetMaskFromImage

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

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.

bool SetMaskFromImage(GenericImage image, RGBValue mask)

Parameters

image GenericImage

Mask image to extract mask shape from. It must have the same dimensions as the image.

mask RGBValue

Mask RGB color.

Returns

bool

Returns false if mask does not have same dimensions as the image or if there is no unused color left. Returns true 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.