Anonymous
FillPath странным образом объединяет AddArc в фигуру
Сообщение
Anonymous » 04 май 2024, 17:08
Код: Выделить всё
BitmapImage = new Bitmap(width,height);
Graphics graphics = Graphics.FromImage(BitmapImage);
SolidBrush solidBrush = new SolidBrush(Color.Purple);
GraphicsPath myGraphicsPath = new GraphicsPath();
myGraphicsPath.AddArc(100,50,50,50,0,-180);
myGraphicsPath.AddLine(new Point(100, 100), new Point(100, 200));
myGraphicsPath.AddLine(new Point(150, 200), new Point(150, 75));
myGraphicsPath.AddArc(100, 175, 50, 50, 0, 180);
graphics.FillPath(solidBrush, myGraphicsPath);
graphics.DrawPath(pen1, myGraphicsPath);
Я хотел нарисовать изогнутую замкнутую фигуру в Winforms C#, но не получилось.
Вот что я хотел нарисовать
.
И что у меня получилось
.
Подробнее здесь:
https://stackoverflow.com/questions/784 ... to-a-shape
1714831680
Anonymous
[code] BitmapImage = new Bitmap(width,height); Graphics graphics = Graphics.FromImage(BitmapImage); SolidBrush solidBrush = new SolidBrush(Color.Purple); GraphicsPath myGraphicsPath = new GraphicsPath(); myGraphicsPath.AddArc(100,50,50,50,0,-180); myGraphicsPath.AddLine(new Point(100, 100), new Point(100, 200)); myGraphicsPath.AddLine(new Point(150, 200), new Point(150, 75)); myGraphicsPath.AddArc(100, 175, 50, 50, 0, 180); graphics.FillPath(solidBrush, myGraphicsPath); graphics.DrawPath(pen1, myGraphicsPath); [/code] Я хотел нарисовать изогнутую замкнутую фигуру в Winforms C#, но не получилось. Вот что я хотел нарисовать [img]https://i.sstatic.net/AJM1xxB8.png[/img] . И что у меня получилось [img]https://i.sstatic.net/6HgcWlzB.png[/img] . Подробнее здесь: [url]https://stackoverflow.com/questions/78426627/fillpath-oddly-merges-addarc-into-a-shape[/url]