Itβs easy to draw arrows just as you drew the lines on PictureBoxin the previous question .
, , StartCap EndCap Pen, , . StartCap , , Pen , EndCap .
LineCap, :
Flat Specifies a flat line cap.
Square Specifies a square line cap.
Round Specifies a round line cap.
Triangle Specifies a triangular line cap.
NoAnchor Specifies no anchor.
SquareAnchor Specifies a square anchor line cap.
RoundAnchor Specifies a round anchor cap.
DiamondAnchor Specifies a diamond anchor cap.
ArrowAnchor Specifies an arrow-shaped anchor cap.
Custom Specifies a custom line cap.
AnchorMask Specifies a mask used to check whether a line cap is an anchor cap.
, ArrowAnchor : ArrowAnchor LineCap ( , , ).
, , 4:
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
using (Pen p = new Pen(Brushes.Green, 4f))
{
p.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
e.Graphics.DrawLine(p, 0, 0, 30, 45);
}
}