Small fixes

This commit is contained in:
Anton 2021-01-27 11:22:04 +01:00
parent ce896750f1
commit 1ee291a02c
1 changed files with 11 additions and 6 deletions

View File

@ -7,7 +7,7 @@ Public Class GUI
Dim drawW, drawH As Integer
Dim drawAspect, gratingAspect As Decimal
Dim scaleDiff As Decimal
Dim pCon1(3) As Decimal 'pCon(0) = pixel X, pCon(2) = SW X
Dim pCon1(3) As Decimal 'pCon(0) = pixel X, pCon(2) = SW X, etc.
Dim pCon2(3) As Decimal
Dim pCon3(3) As Decimal
Dim pCon4(3) As Decimal
@ -21,6 +21,8 @@ Public Class GUI
Set_ContainerPointsX()
Set_ContainerPointsY()
'Create_StartPoints()
End Sub
' --- Retrive parameters for the drawing box ---
@ -58,11 +60,14 @@ Public Class GUI
' --- Draw all the lines for the container ---
Private Sub DrawingPanel_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs)
Dim pen As Pen = New Pen(Color.Black, 1)
e.Graphics.DrawLine(pen, CInt(pCon1(0)), CInt(pCon1(1)), CInt(pCon2(0)), CInt(pCon2(1)))
e.Graphics.DrawLine(pen, CInt(pCon2(0)), CInt(pCon2(1)), CInt(pCon3(0)), CInt(pCon3(1)))
e.Graphics.DrawLine(pen, CInt(pCon3(0)), CInt(pCon3(1)), CInt(pCon4(0)), CInt(pCon4(1)))
e.Graphics.DrawLine(pen, CInt(pCon4(0)), CInt(pCon4(1)), CInt(pCon1(0)), CInt(pCon1(1)))
Dim penCon As Pen = New Pen(Color.DarkRed, 1)
penCon.DashPattern = {4, 8}
e.Graphics.DrawLine(penCon, CInt(pCon1(0)), CInt(pCon1(1)), CInt(pCon2(0)), CInt(pCon2(1)))
e.Graphics.DrawLine(penCon, CInt(pCon2(0)), CInt(pCon2(1)), CInt(pCon3(0)), CInt(pCon3(1)))
e.Graphics.DrawLine(penCon, CInt(pCon3(0)), CInt(pCon3(1)), CInt(pCon4(0)), CInt(pCon4(1)))
e.Graphics.DrawLine(penCon, CInt(pCon4(0)), CInt(pCon4(1)), CInt(pCon1(0)), CInt(pCon1(1)))
'Här måste den anpassa sig till antal punkter som ska ritas och i vilken ordning
End Sub