qq_15122897
qq_15122897
2019-01-10 12:01

C#在tabPage控件中,绘图时为什么不显示

  • c#
  • visual studio

{
Graphics g = tabPag1.CreateGraphic();
//创建钢笔
Pen redPen = new Pen(Color.Red, 6);
Pen bluePen = new Pen(Color.Blue, 4);
Pen greenPen = new Pen(Color.Green, 2);
//创建矩形
Rectangle rect = new Rectangle(80, 80, 50, 50);
//绘制椭圆
g.DrawEllipse(greenPen, 100, 100, 10, 10);
g.DrawEllipse(redPen, rect);
g.DrawEllipse(bluePen, 60, 60, 90, 90);
g.DrawEllipse(greenPen, 40, 40, 130, 130);
//释放对象
redPen.Dispose();
greenPen.Dispose();
bluePen.Dispose();
g.Dispose();
}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换