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.

Syntax

public Void ClipToMask (CGImage mask, CGRect rect)

Parameters

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

Remarks

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.

Requirements

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