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


C# PointF.First方法代码示例

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


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

示例1: GetPolygon

        protected PointF[] GetPolygon(double min_length, params Point3D[] points)
        {
            var pre_calc_map = new PointF[points.Length];
            for (int i = 0; i < points.Length; i++)
            {
                pre_calc_map[i] = GetViewCoordinates(points[i]);
            }

            var point_list = new List<PointF>();
            point_list.Add(pre_calc_map.First());

            int end = points.Length - 1;
            for (int i = 0; i < end; i++)
            {
                foreach (var p in SliceLine(min_length, points[i], points[i + 1], pre_calc_map[i], pre_calc_map[i + 1]))
                {
                    point_list.Add(p);
                }
            }

            point_list.Add(pre_calc_map.Last());

            foreach (var p2 in SliceLine(min_length, points.Last(), points.First(), pre_calc_map.Last(), pre_calc_map.First()))
            {
                point_list.Add(p2);
            }

            return point_list.ToArray();
        }
开发者ID:EFanZh,项目名称:EFanZh,代码行数:29,代码来源:Scene3DBase.cs

示例2: FindMinRectangle

        private static RectangleF FindMinRectangle(PointF[] srcPoints)
        {
            if (srcPoints == null || srcPoints.Count() == 0)
            {
                return new RectangleF();
            }

            var maxLeftPoint = srcPoints.First();
            var maxRightPoint = srcPoints.Last();

            foreach (var srcPoint in srcPoints)
            {
                if (srcPoint.X < maxLeftPoint.X)
                {
                    maxLeftPoint.X = srcPoint.X;
                }

                if (srcPoint.Y < maxLeftPoint.Y)
                {
                    maxLeftPoint.Y = srcPoint.Y;
                }

                if (srcPoint.X > maxRightPoint.X)
                {
                    maxRightPoint.X = srcPoint.X;
                }

                if (srcPoint.Y > maxRightPoint.Y)
                {
                    maxRightPoint.Y = srcPoint.Y;
                }
            }

            return new RectangleF(maxLeftPoint.X, maxLeftPoint.Y, maxRightPoint.X - maxLeftPoint.X, maxRightPoint.Y - maxLeftPoint.Y);
        }
开发者ID:Bubeee,项目名称:RoadSigns.VBP,代码行数:35,代码来源:Homoraphy.cs

示例3: Transform

		public static BoundingBox Transform(this Matrix matrix, BoundingBox bbox)
		{
			PointF minPoint = new PointF((float)bbox.XMin, (float)bbox.YMin);
			PointF maxPoint = new PointF((float)bbox.XMax, (float)bbox.YMax);
			var points = new PointF[] { minPoint, maxPoint };
			matrix.TransformPoints(points);

			minPoint = points.First();
			maxPoint = points.Last();

			return new BoundingBox(minPoint.X, maxPoint.X, minPoint.Y, maxPoint.Y);
		}
开发者ID:xfischer,项目名称:SqlServerSpatial.Toolkit,代码行数:12,代码来源:BoundingBox.cs

示例4: GeoToLogical

		public PointF GeoToLogical(Matrix matrix, PointF pt)
		{
			double px, py = 0;
			BingMapsTileSystem.LatLongToDoubleXY(pt.Y, pt.X, out px, out py);
			pt.X = (float)px;
			pt.Y = (float)py;
			var points = new PointF[] { pt };
			matrix.TransformPoints(points);
			return points.First();
		}
开发者ID:xfischer,项目名称:SqlServerSpatial.Toolkit,代码行数:10,代码来源:SpatialViewer_GDI.cs

示例5: LogicalToGeo

		public PointF LogicalToGeo(Matrix matrix, PointF pt)
		{
			if (matrix.IsInvertible)
			{
				using (Matrix inverseMatrix = matrix.Clone())
				{
					inverseMatrix.Invert();
					var points = new PointF[] { pt };
					inverseMatrix.TransformPoints(points);
					return points.First();
				}
			}
			throw new ArgumentOutOfRangeException();
		}
开发者ID:xfischer,项目名称:SqlServerSpatial.Toolkit,代码行数:14,代码来源:SpatialViewer_GDI.cs

示例6: DrawDays

        public void DrawDays(Graphics graphics, RectangleF outer, RectangleF inner, PointF[] points)
        {
            if (!points.Any()) throw new ArgumentException();

            var brush = GetSolidBrush(LineColor);
            var textBrush = GetSolidBrush(Color);
            var font = GetFont("Arial", 12);
            var oldest = GetOldestMondaiResult();
            var newest = GetNewestMondaiResult();
            var height = outer.Bottom - inner.Bottom;
            //			var oldestRectangle = new RectangleF(outer.Left, inner.Bottom, 100f, height);
            var oldestRectangle = new RectangleF(points.Last().X, inner.Bottom, 100f, height);
            var newestRectangle = new RectangleF(points.First().X, inner.Bottom, 100f, height);
            var stringFormat = new StringFormat()
            {
                Alignment = StringAlignment.Near,
                LineAlignment = StringAlignment.Near,
            };

            // 現在時刻からの最古の日数と最新の日数を表示。最新の日数は最古の日数と被らない限り表示する。
            //			var d0 = MondaiResult.GetStringFromTimeSpan(EPuzzleTime.Now - oldest.StartTime);
            var d0 = (EPuzzleTime.Now - oldest.StartTime).GetShortString();

            var size0 = MeasureString(d0, font);
            //			oldestRectangle.X -= size0.Width / 2f;
            var r0 = new RectangleF(oldestRectangle.Left, oldestRectangle.Top, size0.Width, size0.Height);
            graphics.DrawString(d0, font, textBrush, oldestRectangle, stringFormat);

            //			var d1 = MondaiResult.GetStringFromTimeSpan(EPuzzleTime.Now - newest.StartTime);
            var d1 = (EPuzzleTime.Now - newest.StartTime).GetShortString();

            var size1 = MeasureString(d1, font);
            newestRectangle.X -= size1.Width / 2f;
            var r1 = new RectangleF(newestRectangle.Left, newestRectangle.Top, size1.Width, size1.Height);
            if (!r0.IntersectsWith(r1))
            {
                graphics.DrawString(d1, font, textBrush, newestRectangle, stringFormat);
            }

            if (2 > points.Count()) return;
            var newest2 = OrderedItems[1];
            var newest2Rectangle = new RectangleF(points[1].X, inner.Bottom, 100f, height);
            //			var d2 = MondaiResult.GetStringFromTimeSpan(EPuzzleTime.Now - newest2.StartTime);
            var d2 = (EPuzzleTime.Now - newest2.StartTime).GetShortString();

            var size2 = MeasureString(d2, font);
            newest2Rectangle.X -= size2.Width / 2f;
            var r2 = new RectangleF(newest2Rectangle.Left, newest2Rectangle.Top, size2.Width, size2.Height);
            if (!(r0.IntersectsWith(r2) || r1.IntersectsWith(r2)))
            {
                graphics.DrawString(d2, font, textBrush, newest2Rectangle, stringFormat);
            }
        }
开发者ID:kaijin-games,项目名称:larning-english-game,代码行数:53,代码来源:KirokuBox2.cs


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