salut à tous
ce code est le plus simple possible
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 public partial class Window1 : Window { public Window1() { InitializeComponent(); } public List<Point> LP = new List<Point>(); private void button1_Click(object sender, RoutedEventArgs e) { Point p1; for (int i = 0; i < 300; i++) { for (int j = 0; j < 250; j++) { p1 = new Point(); p1.X = i * 10; p1.Y = j * 10; LP.Add(p1); } } for (int s = 0; s < LP.Count - 3; s++) { Line l = new Line(); l.Stroke = Brushes.Black; l.X1 = LP[s].X; l.Y1 = LP[s].Y; l.X2 = LP[s + 1].X; l.Y2 = LP[s + 1].Y; this.canvas1.Children.Add(l); } this.textBox1.Text = LP.Count.ToString(); } }
je ne sais pas mais peut on faire plus rapide?
Partager