ASP.NET2下画图
我用Graphics画了一个由9个长方形组成的图,并在图形的下方标出了1-9这9个数字,但现在发现第9个数字没有显示出来,只显示了1-8,请教怎么样才能把9显示出来。代码如下:
protected void Page_Load(object sender, EventArgs e)
{
Bitmap bmp = new Bitmap(800, 300);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
int x = 100;
int y = 100;
for (int i = 0; i < 8; i++, x += 60)
{
g.DrawRectangle(Pens.Black, x, y, 60, 35);
g.DrawString(Convert.ToString(i + 1), new Font("Courier New", 10), new SolidBrush(Color.Black), new PointF(x - 5, 140));
}
bmp.Save(Response.OutputStream, ImageFormat.Gif);
}