iOS Guides | Samples

CoreGraphics.CGContext.ClipToMask Method

Modifies the clipping area to the intersection of the current clipping path with mask mapped into the rect.


public Void ClipToMask (CGImage mask, CGRect rect)


The RectangleF into which the mask is mapped.
An image or image mask.


If the mask is an image mask (see CGImage.IsMask), then the clipping occurs as with CGContext.DrawImage, and the mask indicates the area to be left unchanged when drawing.

If the mask is not an image mask, it acts like an alpha mask. The mask must use the color space returned by CGColorSpace.CreateDeviceGray, may not have an alpha component, and may itself not be masked by an image mask or masking color.


Namespace: CoreGraphics
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: