0

我正在尝试为 Paint.Net 编写插件,但为了获得支持,我目前正在使用 C# 在 Visual Studio 2010 中编写代码。我想要实现的是制作曲线并为其制作自定义线帽。我通过编写以下代码实现了主要功能;

SolidBrush myBrushColor1 = new SolidBrush(Amount4);
Pen myPen = new Pen(myBrushColor1, Amount7);
System.Drawing.Point[] pts = { new System.Drawing.Point(0,0), new System.Drawing.Point(0,3), new System.Drawing.Point(3, 0)};
System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddPolygon(pts);
System.Drawing.Drawing2D.CustomLineCap lineCap = new System.Drawing.Drawing2D.CustomLineCap(null, path);

Rectangle arcRect = new Rectangle(0,0,100,100);
g.DrawArc(myPen, arcRect , -90, 90);

这正是我想要实现的,但我想填充作为 CustomEndCap 创建的多边形。现在它被绘制为轮廓。我用谷歌搜索了它,发现我必须更改CustomLineCap(null, path);CustomLineCap(path, null);

我更改了代码并将路径提供为 fillpath 并将 null 作为 strokepath 但它开始给出异常“创建表单时发生错误。有关详细信息,请参阅 Exception.InnerException。错误是:未实现”。

我需要在这里做什么?

4

0 回答 0