本文整理汇总了C#中Point.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# Point.Skip方法的具体用法?C# Point.Skip怎么用?C# Point.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point.Skip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsInPolygon
public static bool IsInPolygon(Point[] poly, Point point)
{
var coef = poly.Skip(1).Select((p, i) => (point.Y - poly[i].Y) * (p.X - poly[i].X) - (point.X - poly[i].X) * (p.Y - poly[i].Y)).ToList();
if (coef.Any(p => p == 0))
return true;
for (int i = 1; i < coef.Count(); i++) {
if (coef[i] * coef[i - 1] < 0)
return false;
}
return true;
}
示例2: DrawLines
private void DrawLines(DrawingContext drawingContext, Pen pen, Point[] points)
{
var pathGeometry = new PathGeometry();
var figure = new PathFigure(points.First(), points.Skip(1).Select(p => new LineSegment(p, true)), true);
pathGeometry.Figures = new PathFigureCollection { figure };
drawingContext.DrawGeometry(null, pen, pathGeometry);
}
示例3: VisualizePoints
private UIElement VisualizePoints(Point[] point)
{
var path = new Path();
path.Stroke = Brushes.Blue;
path.StrokeThickness = 1;
path.Fill = new SolidColorBrush { Color = Colors.Blue, Opacity = 0.2 };
var geometry = new GeometryGroup();
foreach (var pnt in point.Skip(1).Take(point.Length - 2))
geometry.Children.Add(new EllipseGeometry(pnt, 2, 2));
geometry.Children.Add(new EllipseGeometry(point[0], 5, 5));
geometry.Children.Add(new EllipseGeometry(point[point.Length - 1], 5, 5));
geometry.Freeze();
path.Data = geometry;
return path;
}