在c#中怎么给圆心p附初值
2个回答
展开全部
Point center = new Point(20, 20);//圆心
Graphics paper = pictureBox1.CreateGraphics();
paper.Clear(this.BackColor);
SolidBrush aBrush = new SolidBrush(Color.Green);
Pen blackPen = new Pen(Color.Black, 1);
int r = 10;
Rectangle bar = new Rectangle(center.X - r, center.Y - r, center.X + r, center.Y + r);//圆心转换成矩形
paper.FillEllipse(aBrush, bar);
paper.DrawEllipse(blackPen, bar);
bar.Y += 80;
aBrush.Color = Color.Yellow;
paper.FillEllipse(aBrush, bar);
paper.DrawEllipse(blackPen, bar);
bar.Y += 80;
aBrush.Color = Color.Red;
paper.FillEllipse(aBrush, bar);
paper.DrawEllipse(blackPen, bar);
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询