How to: Join Lines
A line join is the common area that is formed by two lines whose ends meet or overlap. GDI+ provides three line join styles: miter, bevel, and round. Line join style is a property of theclass. When you specify a line join style for a Pen object, that join style will be applied to all the connected lines in any object drawn using that pen.
The following illustration shows the results of the beveled line join example.
You can specify the line join style by using theproperty of the Pen class. The example demonstrates a beveled line join between a horizontal line and a vertical line. In the following code, the value assigned to the LineJoin property is a member of the enumeration. The other members of the LineJoin enumeration are and .
GraphicsPath path = new GraphicsPath(); Pen penJoin = new Pen(Color.FromArgb(255, 0, 0, 255), 8); path.StartFigure(); path.AddLine(new Point(50, 200), new Point(100, 200)); path.AddLine(new Point(100, 200), new Point(100, 250)); penJoin.LineJoin = LineJoin.Bevel; e.Graphics.DrawPath(penJoin, path);
Compiling the Code
The preceding example is designed for use with Windows Forms, and it requires e, which is a parameter of the event handler.