本文整理匯總了C#中MonoMac.CoreGraphics.CGContext.ClipToRect方法的典型用法代碼示例。如果您正苦於以下問題:C# CGContext.ClipToRect方法的具體用法?C# CGContext.ClipToRect怎麽用?C# CGContext.ClipToRect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoMac.CoreGraphics.CGContext
的用法示例。
在下文中一共展示了CGContext.ClipToRect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawPattern
void DrawPattern (CGContext context)
{
var start = new sd.PointF(0, 0);
var end = start + sectionSize;
context.ClipToRect(sd.RectangleF.Inflate (new sd.RectangleF(start, tileSize), 4, 4));
if (Wrap == GradientWrapMode.Reflect) {
for (int i = 0; i < 2; i ++) {
context.DrawLinearGradient (Gradient, start, end, 0);
context.DrawLinearGradient (InverseGradient, end, end + sectionSize, 0);
start = start + sectionSize + sectionSize;
end = end + sectionSize + sectionSize;
}
}
else {
for (int i = 0; i < 2; i ++) {
context.DrawLinearGradient (Gradient, start, end, 0);
start = start + sectionSize;
end = end + sectionSize;
}
}
}