Bonjour à tous ,
Je reviens cette fois ci vous demandez de l'aide
J'ai essayé d'avancer tout seul mais la je bloque
Je dois créer une application qui permet de tracer une courbe en fonction du temps.
J'ai un code en c sharp
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 private: System::Void traceCourbe (array <float> ^temperatures) { float a, pasX ; // // a = ((float) pGraphe->Height / (float)(min-max)) ; pasX = (float)(pGraphe->Width) / (float)(nbPts-1) ; drawBrush->Color = colCourbe ; // // array <Point> ^tempsPt = gcnew array <Point> (temperatures->Length) ; array <Point> ^tempsPtLb = gcnew array <Point> (temperatures->Length) ; // // for (int i = 0 ; i < temperatures->Length ; i++) { // // tempsPt[i].Y = (int) (a * (temperatures[i] - max)) ; tempsPt[i].X = (int) (i*pasX) ; // // tempsPtLb[i].Y = tempsPt[i].Y - 10; tempsPtLb[i].X = tempsPt[i].X + 10; // // g->DrawString (temps[i].ToString(), drawFont, drawBrush, tempsPtLb[i] ) ; // // g->DrawArc (penPt,tempsPt[i].X, tempsPt[i].Y, 5, 5, 0, 359) ; } // // g->DrawCurve(penCourbe, tempsPt, 0.2) ; }
et j'aimerais le mettre en visual basic:
Le problème c'est que j'ai pleins de faute :
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
49
50
51
52
53
54
55
56
57 Private Sub p_box_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles p_box.Click Dim a As Double Dim pasX As Double Dim nbPts As Integer Dim gradY As Integer Dim max As Integer Dim min As Integer Dim colCourbe As New System.Drawing.Color Dim colGrille As New System.Drawing.Color Dim g As System.Drawing.Graphics ' méthode Dim tempsPt(temperature->Lenght) as Point Dim tempsPtLb(temperature->Lenght) as Point Dim drawBrush As New SolidBrush(colCourbe) a = ((Double )) p_box->Height /( (Double)(min-max)) pasX =( (Double))(p_box->Width) / (Double)(nbPts-1) Dim tempsPt(temperatures->Length) As point Dim i As Integer = 0 For tempsPt[i].Y = (int) (a * (temperatures[i]) - max)) tempsPt([i].X = (Int())(i * pasX)) tempsPtLb[i].Y = tempsPt[i].Y - 10 tempsPtLb[i].X = tempsPt[i].X + 10 g->DrawString (temps[i].ToString(), drawFont, drawBrush, tempsPtLb[i] ) g->DrawArc (penPt,tempsPt[i].X, tempsPt[i].Y, 5, 5, 0, 359) Next i g->DrawCurve(penCourbe, tempsPt, 0.2) End Sub
Je continue à chercher dans mon coin
Merci à vous
Partager