private void button1_Click(object sender, EventArgs e)
{
Graphics g = pictureBox1.CreateGraphics();
List<Point> points = new List<Point>();//存直线连接的点
for (int x = 0; x < 1000; x ++)
points.Add(new Point(x, (x-50)*(x-50) )); // y=(x-50)^2 函数上点
g.DrawLines(new Pen(new SolidBrush(Color.Black)), points.ToArray());
}
本回答被提问者采纳...graphic 中的DrawLines的用法怎么用?谢谢!
private void button1_Click(object sender, EventArgs e){ Graphics g = pictureBox1.CreateGraphics();List<Point> points = new List<Point>();\/\/存直线连接的点 for (int x = 0; x < 1000; x ++)points.Add(new Point(x, (x-50)*(x-50) )); \/\/ y=(x-50)^2 函数上点...
vb.net 中通过Graphic怎么在原有的图片上绘制DrawLines
一般Graphics都是通过控件比如Panel,PictureBox来进行绘制的,PictureBox pb= new PictureBox();pb.Paint += new System.Windows.Forms.PaintEventHandler(this.Test_Paint);void Test_Paint(object sender, PaintEventArgs e){ Graphics g = e.Graphics;g.DrawImage(...);g.DrawLine(...);} ...