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 Sub DrawGraph(ByRef destination As System.Windows.Forms.Panel, ByVal index As Integer)
Dim Gr As Graphics = destination.CreateGraphics()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim points As New List(Of Point)
Dim deltaP As Single
If firstdraw Then
firstdraw = False
positionDraw = 0
'création des axes y et x
myPen.Color = Color.Black
myPen.DashStyle = 0
myPen.Width = 2
Gr.DrawLine(myPen, 20, 280, 20, 20)
Gr.DrawLine(myPen, 20, 20, 20 - 10, 20 + 10)
Gr.DrawLine(myPen, 20, 20, 20 + 10, 20 + 10)
myPen.Color = Color.Black
myPen.DashStyle = 0
myPen.Width = 2
Gr.DrawLine(myPen, 20, 280, 580, 280)
Gr.DrawLine(myPen, 580, 280, 580 - 10, 280 - 10)
Gr.DrawLine(myPen, 580, 280, 580 - 10, 280 + 10)
'création des axes pmin et pmax
myPen.Color = Color.Green
myPen.DashStyle = 1
myPen.Width = 1
Gr.DrawLine(myPen, 20, 30, 580, 30)
myPen.Color = Color.Red
myPen.DashStyle = 1
myPen.Width = 1
Gr.DrawLine(myPen, 20, 270, 580, 270)
'ajout du texte des axes
Gr.DrawString("P mB", New Font("Arial", 10, FontStyle.Bold), New SolidBrush(Color.Black), 10, 5)
Gr.DrawString("T s", New Font("Arial", 10, FontStyle.Bold), New SolidBrush(Color.Black), 580, 272)
'ajout des valeurs sur les axes
Gr.DrawString(Start.fichier.Mestest(index).pmax * 1000, New Font("Arial", 8, FontStyle.Bold), New SolidBrush(Color.Green), 0, 25)
Gr.DrawString(Start.fichier.Mestest(index).pmin * 1000, New Font("Arial", 8, FontStyle.Bold), New SolidBrush(Color.Red), 0, 265)
'ajout de l'axe du temps fin
myPen.Color = Color.Black
myPen.DashStyle = 1
myPen.Width = 1
Gr.DrawLine(myPen, 570, 280, 570, 30)
'ajout du nombre de seconde
Gr.DrawString(Start.fichier.Mestest(index).tpscalcule, New Font("Arial", 8, FontStyle.Bold), New SolidBrush(Color.Black), 565, 287)
End If |
Partager