日期:2014-05-17 浏览次数:21280 次
for(int i=1;i<=n;i++){
g.DrawLine(Pens.Red, new Point(i*100/n, 0), new Point(i*100/n, 2));
}
Graphics g = this.pictureBox1.CreateGraphics();
g.DrawLine(Pens.Blue, new Point(0, 100), new Point(90, 100));
g.DrawLine(Pens.Blue, new Point(0, 0), new Point(0, 100));
int n = 10;
for (int i = 1; i <= n; i++)
{
g.DrawLine(Pens.Red, new Point(i * 100 / n, 98), new Point(i * 100 / n, 100));
g.DrawString(i.ToString(), SystemFonts.DefaultFont, new SolidBrush(Color.Red), new Point(i * 100 / n, 100));
g.DrawLine(Pens.Red, new Point(0, i * 100 / n), new Point(2, i * 100 / n));
g.DrawString(i.ToString(), SystemFonts.DefaultFont, new SolidBrush(Color.Red), new Point(2, i * 100 / n));
}