private void Form1_Load(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
g.SmoothingMode = SmoothingMode.AntiAlias;
g.FillEllipse(new SolidBrush(Color.Black), new Rectangle(0, 0, 50, 50));
g.Dispose();
}
运行后什么都没有。求解释啊。。
{
Graphics g = this.CreateGraphics();
g.SmoothingMode = SmoothingMode.AntiAlias;
g.FillEllipse(new SolidBrush(Color.Black), new Rectangle(0, 0, 50, 50));
g.Dispose();
}
运行后什么都没有。求解释啊。。
先获得form窗口的句柄
Load 在第一次显示窗体前发生。
OnPaint 引发 Paint 事件。 (重写 Control.OnPaint(PaintEventArgs)。) 引发Paint事件,才会重绘控件。
{
Graphics g = this.CreateGraphics();
g.SmoothingMode = SmoothingMode.AntiAlias;
g.FillEllipse(new SolidBrush(Color.Black), new Rectangle(0, 0, 50, 50));
g.Dispose();
}
运行后 发现是个黑色的园。。
{
Graphics g = this.CreateGraphics();
g.SmoothingMode = SmoothingMode.AntiAlias;
g.FillEllipse(new SolidBrush(Color.Black), new Rectangle(0, 0, 50, 50));
g.Dispose();
}