当前位置: 首页>>代码示例>>C#>>正文


C# PointF.Skip方法代码示例

本文整理汇总了C#中System.Drawing.PointF.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# PointF.Skip方法的具体用法?C# PointF.Skip怎么用?C# PointF.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Drawing.PointF的用法示例。


在下文中一共展示了PointF.Skip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsInPolygon

        private static bool IsInPolygon(PointF[] poly, PointF 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;
        }
开发者ID:kingofcrabs,项目名称:NetDesigner,代码行数:17,代码来源:Polygon.cs

示例2: DrawSegments

        public void DrawSegments(PointF[] Stroke)
        {
            if (RenderMethod == RenderMode.Standard)
            {
                // Ensure that surface is visible
                if (!this.Visible)
                {
                    this.TopMost = true;
                    this.Show();
                }

                // Create list of points that are new this draw
                List<PointF> NewPoints = new List<PointF>();

                // Get number of points added since last draw including last point of last stroke and add new points to new points list
                int iDelta = Stroke.Count() - LastStroke.Count() + 1;
                NewPoints.AddRange(Stroke.Skip(Stroke.Count() - iDelta).Take(iDelta));

                // Draw new line segments to main drawing surface
                SurfaceGraphics.DrawLines(DrawingPen, NewPoints.Select(p => TranslatePoint(p)).ToArray());

                // Set last stroke to copy of current stroke
                // ToList method creates value copy of stroke list and assigns it to last stroke
                LastStroke = Stroke.ToList();
            }
            else
            {
                foreach (CompatibilitySurface surface in CompatibilitySurfaces)
                    surface.SurfaceGraphics.DrawLines(DrawingPen, surface.OffsetPoints(Stroke));
            }
        }
开发者ID:floatas,项目名称:highsign,代码行数:31,代码来源:Surface.cs

示例3: Properize

 public static PointF[] Properize(PointF[] points, Size pattern)
 {
     var res = new PointF[points.Length];
     var hs = new int[pattern.Height];
     for (var i = 0; i < pattern.Height; i++) hs[i] = i;
     var heighted = hs.Select(h => points.Skip(h * pattern.Width).Take(pattern.Width).OrderBy(p => p.X).ToArray())
         .OrderBy(r => r.OrderBy(p => p.X).Select(p => p.Y).First()).ToArray();
     for (var y = 0; y < pattern.Height; y++)
     {
         for (var x = 0; x < pattern.Width; x++)
             res[x + y * pattern.Width] = heighted[y][x];
     }
     return res;
 }
开发者ID:virrkharia,项目名称:dynamight,代码行数:14,代码来源:StereoCalibration.cs


注:本文中的System.Drawing.PointF.Skip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。