當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。