1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
private void pictureBoxGraph_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics
Pen crayon = new Pen(Color.Black);
// Points pour ligne 1
Point point1 = new Point(15, 150);
Point point2 = new Point(20, 160);
// Points pour ligne 2
Point point3 = new Point(20,160);
Point point4 = new Point(25, 157);
// Dessiner les 2 lignes
g.DrawLine(crayon, point1, point2);
g.DrawLine(crayon, point3, point4);
/* Tu peux aussi utiliser la fonction DrawLines() et passer en paramètre
* un tableau de points, ce qui serait beaucoup plus logique dans ton cas
*/
} |
Partager