0

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?

Adnan Yaseen
  • 833
  • 1
  • 15
  • 44
  • Please don't prefix your titles with "C# Drawing2D" and such. That's what the tags are for. – John Saunders Apr 27 '12 at 19:45
  • Sorry, but this is my very first post here. Will keep that in mind for future. – Adnan Yaseen Apr 27 '12 at 19:47
  • [Cross-posted on social.msdn](https://social.msdn.microsoft.com/Forums/en-US/588903ca-17c6-4ea6-99fb-e0cd3c5ea6df/c-drawing2d-customlinecap-fillpath-insetad-of-strokepath?forum=csharplanguage). – user202729 Aug 05 '18 at 04:11

0 Answers0