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
|
' le code de chargement (que l'on peut remplacer par du "manuel" jusqu'à la ligne rouge)
Option Explicit
Private Sub Form_Load()
With Picture1
.ScaleMode = 3
.BorderStyle = 0
.BackColor = Me.BackColor
.ForeColor = RGB(0, 0, 1)
.FontSize = 50
.FontBold = True
.FillColor = RGB(0, 0, 0)
.FillStyle = 0
End With
'========================
Picture1.Width = (5 * Picture1.FontSize) * Screen.TwipsPerPixelX
Picture1.Height = (5 * Picture1.FontSize) * Screen.TwipsPerPixelY
Picture1.CurrentX = Picture1.ScaleWidth / 1.5
Picture1.CurrentY = Picture1.ScaleHeight / 2
Picture1.Circle (Picture1.CurrentX, Picture1.CurrentY), Picture1.ScaleWidth / 3, RGB(120, 120, 100), , , 0.8
Picture1.CurrentX = Picture1.ScaleWidth / 2.2
Picture1.CurrentY = (Picture1.ScaleHeight / 6) + (Picture1.FontSize)
Randomize
Picture1.Print Int(Rnd * 9999) + 1
End Sub
'le code du grattage à proprement parler :
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim I As Integer, J As Integer, n As Integer
If Button = 1 Then
For I = 0 To 10
For J = 0 To 10
For n = -3 To 3
If Picture1.Point(X + I + n, Y + I) = Picture1.FillColor Then
Picture1.PSet (X + I + n, Y + I), RGB(255, 255, 255)
End If
Next n
Next
Next
End If
End Sub |
Partager