Hallo Community,
ich habe ein Fenster generiert, welches mit einer Region dargestellt wird.
Diese sieht wie folgt aus:
GraphicsPath gp = new GraphicsPath();
gp.AddLine(10, 0, Width - 11, 0);
gp.AddCurve(new Point[] { new Point(Width - 11, 0), new Point(Width - 4, 3), new Point(Width - 1, 10) }, 0.5F);
gp.AddLine(Width - 1, 10, Width - 1, Height - 11);
gp.AddCurve(new Point[] { new Point(Width - 1, Height - 11), new Point(Width - 4, Height - 3), new Point(Width - 11, Height - 1) }, 0.5F);
gp.AddLine(Width - 11, Height - 1, 10, Height - 1);
gp.AddCurve(new Point[] { new Point(10, Height - 1), new Point(3, Height - 4), new Point(0, Height - 11) }, 0.5F);
gp.AddLine(0, Height - 11, 0, 10);
gp.AddCurve(new Point[] { new Point(0, 10), new Point(3, 3), new Point(10, 0) }, 0.5F);
Region = new Region(gp);
gp.Dispose();
Jetzt versuche ich im OnPaint-Event einen Rahmen um die Geschichte zu zeichnen. Allerdings werden alle Kurven nur teilweise, sowie die Linien rechts und unten garnicht dargestellt.
Dieser wird mit dem gleichen GraphicalPath gezeichnet:
GraphicsPath gp = new GraphicsPath();
gp.AddLine(10, 0, Width - 11, 0);
gp.AddCurve(new Point[] { new Point(Width - 11, 0), new Point(Width - 4, 3), new Point(Width - 1, 10) }, 0.5F);
gp.AddLine(Width - 1, 10, Width - 1, Height - 11);
gp.AddCurve(new Point[] { new Point(Width - 1, Height - 11), new Point(Width - 4, Height - 3), new Point(Width - 11, Height - 1) }, 0.5F);
gp.AddLine(Width - 11, Height - 1, 10, Height - 1);
gp.AddCurve(new Point[] { new Point(10, Height - 1), new Point(3, Height - 4), new Point(0, Height - 11) }, 0.5F);
gp.AddLine(0, Height - 11, 0, 10);
gp.AddCurve(new Point[] { new Point(0, 10), new Point(3, 3), new Point(10, 0) }, 0.5F);
e.Graphics.DrawPath(Pens.Black, gp);
gp.Dispose();
Könnt ihr mir sagen, wieso die Darstellung falsch ist und was dessen Lösung wäre?
Ich danke im Voraus.
Mit freundlichem Gruß
Lost-Ha[n]f-PHP