Devesprit.ImageProcessor & Devesprit.ImageServer
Mask

Description:

Applies the given image mask to the current image. Any area containing transparency within the mask will be removed from the original image. If the mask is larger than the image it will be resized to match the images dimensions.

Method Declaration
Copy Code
public ImageFactory Mask(ImageLayer imageLayer)

ImageLayer:

Image

The desired image mask (System.Drawing.Image).

Position The Nullable<System.Drawing.Point> to place the mask if it not the same dimensions as the original image. If no position is set, the mask will be centered within the image.

Assembly:

Devesprit.ImageProcessor

Example
Copy Code
new ImageFactory().Load(@"My-Image-Path")
.Mask(new ImageLayer() {Image = Image.FromFile("circle.png"), Position = new Point(70, 30)});

Original

 

 

Result