我试图填补我的两个半圆。我想要一面黑色,另一面白色。我用什么?
这是我的代码片段:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Rectangle rect = new Rectangle(100, 100, 320, 320);
e.Graphics.DrawArc(new Pen(new SolidBrush(Color.Black), 10), rect, 90, 180);
e.Graphics.DrawArc(new Pen(new SolidBrush(Color.White), 10), rect, 270, 180);
}
Run Code Online (Sandbox Code Playgroud) 我想在C#windows Form Application上绘制YinYang符号.到目前为止,我画了一个大的外圈和两个内在的圈子.
我需要帮助绘制沿圆圈中间延伸的曲线部分
另外,我如何填充小圆圈和圆圈的另一半为黑色.
此外,无需使用按钮即可绘制(请参阅代码).
这是我的代码片段:
private void button1_Click(object sender, EventArgs e)
{
Graphics myGraphics = base.CreateGraphics();
Pen myPen = new Pen(Color.Black);
SolidBrush mySolidBrush = new SolidBrush(Color.Black);
myGraphics.DrawEllipse(myPen, 50,50, 150, 150);
Graphics innerCircle = base.CreateGraphics();
Pen myPen2 = new Pen(Color.Black);
SolidBrush mySolidBrush2 = new SolidBrush(Color.Black);
myGraphics.DrawEllipse(myPen, 118, 75, 20, 20);
Graphics innerCircle2 = base.CreateGraphics();
Pen myPen3 = new Pen(Color.Black);
SolidBrush mySolidBrush3 = new SolidBrush(Color.Black);
myGraphics.DrawEllipse(myPen, 118, 150, 20, 20);
}
Run Code Online (Sandbox Code Playgroud)