我试图绘制多个箭头窗体上的彩色轮廓,到目前为止我用下面的代码:绘制箭头与轮廓
Pen arrow_pen = new Pen(Color.FromArgb(r, g, b), 8);
arrow_pen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
GraphicsPath arrow = new GraphicsPath();
arrow.AddLine(
coordinates1,
coordinates2,
coordinates3,
coordinates4
);
obj.DrawPath(arrow_pen, arrow);
obj.FillPath(Brushes.White, arrow);
arrow.Dispose();
arrow_pen.Dispose();
它把大纲的箭头,但它然后剂量用白色填充路径(obj.FillPath什么都不做),我错过了什么,或者我是否以错误的方式做这件事?
'obj'绝对是'Graphics'类型的吗? – 2014-08-27 08:21:38
其定义如下:'使用(Graphics obj = this.CreateGraphics())' – Hauba 2014-08-27 08:29:17
改为使用AddPolygon()。切勿使用CreateGraphics。 – 2014-08-27 08:41:18