Content |
Paint an image (stencil) mask.
An image mask is a monochrome image, in which each sample is specified by a single bit. However, instead of being painted in opaque black and white, the image mask is treated as a stencil mask that is partly opaque and partly transparent. Sample values in the image do not represent black and white pixels; rather, they designate places on the content that should either be marked with the given paint or masked out (not marked at all). Areas that are masked out retain their former content.
The effect is like applying paint in the current color through a cut-out stencil, which allows the paint to reach the page in some places and masks it out in others.
public void PaintImageMask( ImageMask imageMask, Rectangle targetRect, Paint paint )
Exception | Condition |
---|---|
InvalidOperationException | if the document associated with the content has already been closed |
InvalidOperationException | if the page/group associated with the content has already been closed |
InvalidOperationException | if the content object has already been closed |
InvalidOperationException | if the object has already been closed |
ArgumentException | if the document associated with imageMask has already been closed |
ArgumentException | if the imageMask object is not an image mask |
ArgumentException | if the imageMask is associated with a different document |
ArgumentException | if the document associated with paint has already been closed |
ArgumentException | if the paint is associated with a different document |
ArgumentNullException | if imageMask is . |
ArgumentNullException | if paint is . |