1 回答

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超4個(gè)贊
用GDI+畫出來,在form的Paint事件中添加如下代碼(自己調(diào)下坐標(biāo)值):
Graphics graphic = e.Graphics;
Pen pen = new Pen(Color.Blue);
for (int i=0; i < 200; i++)
{
for (int j=0; j < 200; j++)
{
graphic.DrawEllipse(pen, x, y, 1, 1);
graphic.DrawString("("+i+","+j+")",new Font("Verdana",5), new SolidBrush(Color.Tomato),i,j);
}
}
另外沒弄懂你的賦值是什么用意,如果純顯示,這樣效果好些:
Graphics graphic = e.Graphics;
Pen pen = new Pen(Color.Blue);
for (int x=0, i=0; x < 400; x+=40, i++)
{
for (int y=0, j=0; y < 400; y+=40, j++)
{
graphic.DrawEllipse(pen, x, y, 1, 1);
graphic.DrawString("("+i+","+j+")",new Font("Verdana",5), new SolidBrush(Color.Tomato),x,y);
}
}
添加回答
舉報(bào)