#Region "Show digital Number"
Private Function conPol(ByVal i As Integer) As Point()
Dim c, h As Integer
Dim x As Integer = _position.X
Dim y As Integer = _position.Y
Dim poly(3) As Point
Select Case i
Case 1
c = x
h = y – _width – 2
poly(0).X = c
poly(0).Y = h
poly(1).X = c + _width
poly(1).Y = h
poly(2).X = c + _width – _thick
poly(2).Y = h + _thick
poly(3).X = c + _thick
poly(3).Y = h + _thick
Return poly
Case 2
c = x + _width
h = y – _width – 1
poly(0).X = c
poly(0).Y = h
poly(1).X = c
poly(1).Y = h + _width
poly(2).X = c – _thick
poly(2).Y = h + _width – _thick / 2
poly(3).X = c – _thick
poly(3).Y = h + _thick
Return poly
Case 3
c = x + _width
h = y + 1
poly(0).X = c
poly(0).Y = h
poly(1).X = c
poly(1).Y = h + _width
poly(2).X = c – _thick
poly(2).Y = h + _width – _thick
poly(3).X = c – _thick
poly(3).Y = h + _thick / 2
Return poly
Case 4
c = x + _width
h = y + _width + 2
poly(0).X = c
poly(0).Y = h
poly(1).X = c – _width
poly(1).Y = h
poly(2).X = c – _width + _thick
poly(2).Y = h – _thick
poly(3).X = c – _thick
poly(3).Y = h – _thick
Return poly
Case 5
c = x
h = y + _width + 1
poly(0).X = c
poly(0).Y = h
poly(1).X = c
poly(1).Y = h – _width
poly(2).X = c + _thick
poly(2).Y = h – _width + _thick / 2
poly(3).X = c + _thick
poly(3).Y = h – _thick
Return poly
Case 6
c = x
h = y – 1
poly(0).X = c
poly(0).Y = h
poly(1).X = c
poly(1).Y = h – _width
poly(2).X = c + _thick
poly(2).Y = h – _width + _thick
poly(3).X = c + _thick
poly(3).Y = h – _thick / 2
Return poly
Case 7
ReDim poly(5)
c = x
h = y
poly(0).X = c
poly(0).Y = h
poly(1).X = c + _thick
poly(1).Y = h – _thick / 2
poly(2).X = c + _width – _thick
poly(2).Y = h – _thick / 2
poly(3).X = c + _width
poly(3).Y = h
poly(4).X = c + _width – _thick
poly(4).Y = h + _thick / 2
poly(5).X = c + _thick
poly(5).Y = h + _thick / 2
Return poly
End Select
End Function
Private Sub show(ByVal g As Graphics, ByVal led1 As Boolean, _
ByVal led2 As Boolean, ByVal led3 As Boolean, _
ByVal led4 As Boolean, ByVal led5 As Boolean, _
ByVal led6 As Boolean, ByVal led7 As Boolean)
led(g, 1, led1)
led(g, 2, led2)
led(g, 3, led3)
led(g, 4, led4)
led(g, 5, led5)
led(g, 6, led6)
led(g, 7, led7)
End Sub
Private Sub led(ByVal g As Graphics, ByVal led As Integer, _
ByVal sta As Boolean)
If СКАЧАТЬ