Hallo,
eigentlich möchte ich beim Zeichnen eines Strings lieber GraphicsPath anstelle von Graphics nutzen.
Leider sieht die Ausgabe bei der Benutzung von GraphicsPath total gestaucht aus. Woran kann dies liegen?
Version 1 - Graphics
g.DrawString("Teststring",
new Font("Arial", 12),
Brushes.Black,
20, 20);
Version 2 - GraphicsPath
using (GraphicsPath gp = new GraphicsPath())
{
gp.AddString("Teststring",
new FontFamily("Arial"),
(int)FontStyle.Regular,
12,
new PointF(20,60),
StringFormat.GenericDefault);
g.FillPath(Brushes.Black, gp);
}
Torsten
eigentlich möchte ich beim Zeichnen eines Strings lieber GraphicsPath anstelle von Graphics nutzen.
Leider sieht die Ausgabe bei der Benutzung von GraphicsPath total gestaucht aus. Woran kann dies liegen?
Version 1 - Graphics
g.DrawString("Teststring",
new Font("Arial", 12),
Brushes.Black,
20, 20);
Version 2 - GraphicsPath
using (GraphicsPath gp = new GraphicsPath())
{
gp.AddString("Teststring",
new FontFamily("Arial"),
(int)FontStyle.Regular,
12,
new PointF(20,60),
StringFormat.GenericDefault);
g.FillPath(Brushes.Black, gp);
}
Torsten
Comment