Arrows

  • Thread starter Thread starter Guest
  • Start date Start date
I'm sure you can port this VB ;-)

Dim p As New Pen(Color.Red)
p.StartCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor
p.EndCap = System.Drawing.Drawing2D.LineCap.Flat
p.Width = 2
Me.CreateGraphics.DrawLine(p, 200, 200, 400, 400)

Those caps are pretty small, but there is a CustomLineCap class that I
believe lets you define your own caps using a Path. I've never used the
Custom option myself, sorry.

Robert Smith
Kirkland, WA
www.smithvoice.com
 
Hello,

I tried it with your code like that:

System.Drawing.Pen myPen = null;
myPen.StartCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
myPen.EndCap = System.Drawing.Drawing2D.LineCap.Flat;
myPen.Width = 2;
System.Drawing.Graphics formGraphics = this.CreateGraphics();
formGraphics.DrawLine(myPen, a, b, c, d);
myPen.Dispose();
formGraphics.Dispose();

But I always get a NullReferenceException. Does anybody know what went wrong
here?

regards

mat
 
Back
Top