本文整理汇总了C#中CGPoint.Union方法的典型用法代码示例。如果您正苦于以下问题:C# CGPoint.Union方法的具体用法?C# CGPoint.Union怎么用?C# CGPoint.Union使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGPoint
的用法示例。
在下文中一共展示了CGPoint.Union方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawRightForwardBackward
private void DrawRightForwardBackward()
{
//get graphics context
using (CGContext g = UIGraphics.GetCurrentContext ()) {
//set up drawing attributes
g.SetLineWidth (STROKE_WIDTH);
//g.SetFillColor (0, 0, 178, 255);
FILL.SetFill ();
STROKE.SetStroke ();
var outline = new CGPath();
var body = new CGPath ();
var x0 = 0;
var x1 = this.Frame.Width * GUTTER;
var x2 = this.Frame.Width - x1;
var x3 = this.Frame.Width;
var y0 = 0;
var y1 = this.Frame.Height * GUTTER;
var y2 = this.Frame.Height - y1;
var y3 = this.Frame.Height;
var trPoints = new CGPoint[] {
new CGPoint (x2, y0),
new CGPoint (x2, y1),
new CGPoint (x3, y1)
};
var bPoints = new CGPoint[] {
new CGPoint (x3, y2),
new CGPoint (x2, y2),
new CGPoint (x2, y3)
};
var tlPoints = new CGPoint[] {
new CGPoint (x1, y3),
new CGPoint (x1, y0),
};
body.AddLines (trPoints.Union(bPoints).Union(tlPoints).ToArray());
body.CloseSubpath ();
outline.AddLines (trPoints);
outline.AddLines (bPoints);
outline.AddLines (tlPoints);
g.AddPath(body);
g.DrawPath(CGPathDrawingMode.Fill);
g.AddPath(outline);
g.DrawPath(CGPathDrawingMode.Stroke);
}
}