本文整理汇总了C#中GraphicsPath.AddLines方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsPath.AddLines方法的具体用法?C# GraphicsPath.AddLines怎么用?C# GraphicsPath.AddLines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsPath
的用法示例。
在下文中一共展示了GraphicsPath.AddLines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetArrowLinePath
public static GraphicsPath GetArrowLinePath(float x1, float y1, float x2, float y2, bool include_arrow, float extra_thickness = 0)
{
var newPoints = GetArrowLinePoints(x1, y1, x2, y2, extra_thickness);
var path = new GraphicsPath(FillMode.Winding);
path.AddLines(newPoints.ToArray());
//if (include_arrow)
// path.AddLines(GetArrowPoints(x2, y2, extra_thickness).ToArray());
//path.CloseFigure();
return path;
}
示例2: GetOutlinePath
protected override GraphicsPath GetOutlinePath(int index)
{
Point[] pts = new Point[8]();
if (Appearance == WeifenLuo.WinFormsUI.DockPane.AppearanceStyle.Document)
{
Rectangle rectTab = GetTabRectangle(index);
rectTab.Intersect(TabsRectangle);
int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Bottom))).Y;
Rectangle rectPaneClient = DockPane.ClientRectangle;
pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
pts[1] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
pts[2] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
pts[3] = PointToScreen(new Point(rectTab.Right + _DocumentTabOverlap, rectTab.Top));
pts[4] = PointToScreen(new Point(rectTab.Right + _DocumentTabOverlap, rectTab.Bottom));
pts[5] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
pts[6] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Bottom));
pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Bottom));
}
else
{
Rectangle rectTab = GetTabRectangle(index);
rectTab.Intersect(TabsRectangle);
int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Top))).Y + 1;
Rectangle rectPaneClient = DockPane.ClientRectangle;
pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Top));
pts[1] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Top));
pts[2] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
pts[3] = PointToScreen(new Point(rectTab.Right + 1, rectTab.Top));
pts[4] = PointToScreen(new Point(rectTab.Right + 1, rectTab.Bottom));
pts[5] = PointToScreen(new Point(rectTab.Left + 1, rectTab.Bottom));
pts[6] = PointToScreen(new Point(rectTab.Left + 1, rectTab.Top));
pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
}
GraphicsPath path = new GraphicsPath();
path.AddLines(pts);
return path;
}