请问哪位高手可以指点一下C#中 graphic 中的DrawLines的用法怎么用?谢谢!

如题所述

第1个回答  2010-11-25

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(...);} ...

相似回答