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
| Sub colorierPyramide(ByVal ligneSommet As Integer, _
ByVal colSommet As Integer, _
ByVal n As Integer, _
ByVal c As Long)
Dim i As Integer
Dim L As Integer
L = 1
For i = 0 To n
colorierSegment ligneSommet + i, colSommet - i, L + 2 * i, c
Next i
End Sub
Sub colorierSegment(ByVal ligne As Integer, _
ByVal col As Integer, _
ByVal L As Integer, _
ByVal c As Long)
colorierRectangle ligne, col, ligne, col + (L - 1), c
End Sub
Sub colorierPyramideBas(ByVal ligneSommet As Integer, _
ByVal colSommet As Integer, _
ByVal n As Integer, _
ByVal c As Long)
Dim i As Integer
Dim L As Integer
L = 1
For i = 0 To n
colorierSegment ligneSommet - i, colSommet - i, L + (2 * i), c
Next i
End Sub |
Partager