在ASP.NET中的两点之间绘制箭头

时间:2011-09-08 01:36:43

标签: c# .net asp.net graphics

我在ASP.NET中动态生成图像。如何在下面的代码段中绘制箭头而不是线条。我找不到任何API。

Bitmap image = new Bitmap(640, 480);
Graphics graphics = Graphics.FromImage(image);
.
.
graphics.DrawLine(new Pen(Color.Red), lPoint, rPoint);

1 个答案:

答案 0 :(得分:4)

Bitmap image = new Bitmap(640, 480);
Graphics graphics = Graphics.FromImage(image);
Pen p = new Pen(Color.Red, 10);
p.EndCap = LineCap.ArrowAnchor;
graphics.DrawLine(p, lPoint, rPoint);

请参阅LineCap Enumeration MSDN