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


C# GraphicsPath.ClearMarkers方法代码示例

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


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

示例1: ClearMarkers2

        private void ClearMarkers2(Graphics g)
        {
            // Create a path and set two markers.
            GraphicsPath myPath = new GraphicsPath();
            myPath.AddLine(new Point(0, 0), new Point(50, 50));
            myPath.SetMarkers();
            Rectangle rect = new Rectangle(50, 50, 50, 50);
            myPath.AddRectangle(rect);
            myPath.SetMarkers();
            myPath.AddEllipse(100, 100, 100, 50);

            var pathPoints = myPath.PathPoints;
            var pathTypes = myPath.PathTypes;

            Console.WriteLine("ClearMarkers Before reverse");
            for (int i = 0; i < myPath.PathTypes.Length; i++)
            {
                Console.WriteLine("{0} - {1},{2}", (PathPointType)pathTypes[i], pathPoints[i].X, pathPoints[i].Y);
            }

            // Draw the path to screen.
            g.FillPath(Brushes.Red, myPath);
            g.DrawPath(new Pen(Color.Black, 2), myPath);

            // Draw the first set of points to the screen.
            DrawPoints2(g, myPath.PathPoints, 20);

            // Call GraphicsPath.Reverse.
            myPath.Reverse();

            pathPoints = myPath.PathPoints;
            pathTypes = myPath.PathTypes;

            Console.WriteLine("ClearMarkers After reverse");
            for (int i = 0; i < myPath.PathTypes.Length; i++)
            {
                Console.WriteLine("{0} - {1},{2}", (PathPointType)pathTypes[i], pathPoints[i].X, pathPoints[i].Y);
            }

            // Call GraphicsPath.ClearMarkers.
            myPath.ClearMarkers();

            pathPoints = myPath.PathPoints;
            pathTypes = myPath.PathTypes;

            Console.WriteLine("ClearMarkers After Clear");
            for (int i = 0; i < myPath.PathTypes.Length; i++)
            {
                Console.WriteLine("{0} - {1},{2}", (PathPointType)pathTypes[i], pathPoints[i].X, pathPoints[i].Y);
            }
            // Draw the path to screen.
            g.FillPath(Brushes.CornflowerBlue, myPath);
            g.DrawPath(new Pen(Color.Black, 2), myPath);

            // Draw the reversed set of points to the screen.
            DrawPoints2(g, myPath.PathPoints, 150);
        }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:57,代码来源:DrawingView.cs

示例2: ClearMarkers1

        private void ClearMarkers1(Graphics g)
        {
            // Create a path and set two markers.
            GraphicsPath myPath = new GraphicsPath();
            myPath.AddLine(new Point(0, 0), new Point(50, 50));
            myPath.SetMarkers();
            Rectangle rect = new Rectangle(50, 50, 50, 50);
            myPath.AddRectangle(rect);
            myPath.SetMarkers();
            myPath.AddEllipse(100, 100, 100, 50);

            myPath.ClearMarkers ();

            // Draw the path to screen.
            g.DrawPath(new Pen(Color.Black, 2), myPath);
        }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:16,代码来源:DrawingView.cs

示例3: SetPath

        protected void SetPath(RectangleF rect, out GraphicsPath path)
        {
            path = new GraphicsPath();
            path.ClearMarkers();
            RectangleF tl = new RectangleF(rect.Left, rect.Top, 20, 20);
            RectangleF tr = new RectangleF(rect.Right - 20, rect.Top, 20, 20);
            RectangleF bl = new RectangleF(rect.Left, rect.Bottom - 20, 20, 20);
            RectangleF br = new RectangleF(rect.Right - 20, rect.Bottom - 20, 20, 20);

            path.AddArc(tl, 179, 91);
            path.AddArc(tr, 269, 91);
            path.AddArc(br, 359, 91);
            path.AddArc(bl, 89, 91);

            path.CloseFigure();
        }
开发者ID:eprimo,项目名称:Linc-Reporting-Service,代码行数:16,代码来源:Keyboard.cs

示例4: refreshPath

        protected override void refreshPath()
        {
            path = new GraphicsPath();
            Rectangle rect = new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width, this.ClientRectangle.Height);
            Point p1 = new Point(rect.Width / 2, 0);
            Point p2 = new Point(rect.Width, rect.Height / 2);
            Point p3 = new Point(rect.Width / 2, rect.Height);
            Point p4 = new Point(0, rect.Height / 2);

            if (type == RelationshipType.AssociativeEntity)
            {
                path.ClearMarkers();
                path.AddRectangle(rect);
            }
            else
            {
                path.ClearMarkers();
                path.AddPolygon(new Point[] { p1, p2, p3, p4 });
            }

            this.Region = new Region(path);
        }
开发者ID:rsuneja,项目名称:erdesigner,代码行数:22,代码来源:RelationshipShape.cs

示例5: ClearMarkers

		public void ClearMarkers()
		{
			path = new GraphicsPath ();
			path.AddEllipse (0, 0, 100, 200);
			path.SetMarkers ();
			path.AddLine (new Point (100, 100), new Point (200, 100));
			Rectangle rect = new Rectangle (200, 0, 100, 200);
			path.AddRectangle (rect);
			path.SetMarkers ();
			path.AddLine (new Point (250, 200), new Point (250, 300));
			path.SetMarkers ();

			path.ClearMarkers();

			GraphicsPathIterator pathIterator = new GraphicsPathIterator(path);
			pathIterator.Rewind ();
			int [] pointsNumber = new int [] {21, 0, 0, 0};
			for (int i=0; i < 4; i ++) {
				Assert.AreEqual (pointsNumber [i], pathIterator.NextMarker (path));
			}
			//t.AssertCompare ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:22,代码来源:GraphicsPath.cs


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