C#中的Graphics g = e.Graphics是什么意思?
protectedoverridevoidOnPaint(PaintEventArgse){Graphicsg=e.Graphics;using(PenbluePen=n...
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
using (Pen bluePen = new Pen(Color.Red, 1))
{
if (ClientRectangle.Height / 10 > 0)
{
for (int y = 0; y < ClientRectangle.Height; y += ClientRectangle.Height / 10)
{
g.DrawLine(bluePen, new Point(0, 0), new Point(ClientRectangle.Width, y));
}
}
}
}
求大神指教Graphics g = e.Graphics; 这句话是什么意思呢? 展开
{
Graphics g = e.Graphics;
using (Pen bluePen = new Pen(Color.Red, 1))
{
if (ClientRectangle.Height / 10 > 0)
{
for (int y = 0; y < ClientRectangle.Height; y += ClientRectangle.Height / 10)
{
g.DrawLine(bluePen, new Point(0, 0), new Point(ClientRectangle.Width, y));
}
}
}
}
求大神指教Graphics g = e.Graphics; 这句话是什么意思呢? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |