I am trying to write a plugin for Paint.Net but for support I am currently writing the code in Visual Studio 2010 using C#. What I am trying to acheive is to make a curve and make a custom line cap for it. I have acheived the major functionality by writing the following code;
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);
This is exactly what I want to acheive but I want to fill the Polygon created as a CustomEndCap. Right now it is drawn as outline. I have googled it and found that I have to change CustomLineCap(null, path);
to CustomLineCap(path, null);
I changed the code and provided path as fillpath and null as strokepath but it started giving Exception "An error occurred creating the form. See Exception.InnerException for details. The error is: Not implemented".
What I need to do here?