本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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);
}
示例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 ();
}