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