|
Option Explicit
Global Const SRCCOPY = &HCC0020
Public Declare Function BitBlt Lib "gdi32" (ByVal _
hDestDC As Long, ByVal x As Long, ByVal y As Long, _
ByVal nWidth As Long, ByVal nHeight As Long, _
ByVal hSrcDC As Long, ByVal xSrc As Long, _
ByVal ySrc As Long, ByVal dwRop As Long) As Long
Public Sub Wuerfeln(WPic As PictureBox, Color As Integer, _
W1 As PictureBox, W2 As PictureBox, W3 As PictureBox, _
W4 As PictureBox, W5 As PictureBox)
Dim A As Long
Dim B As Long
Dim C As Long
Dim D As Long
Dim E As Long
Randomize
A = Int(6 * Rnd + 1)
Randomize
B = Int(6 * Rnd + 1)
Randomize
C = Int(6 * Rnd + 1)
Randomize
D = Int(6 * Rnd + 1)
Randomize
E = Int(6 * Rnd + 1)
ZeigeWuerfel WPic, W1, A, Color
ZeigeWuerfel WPic, W2, B, Color
ZeigeWuerfel WPic, W3, C, Color
ZeigeWuerfel WPic, W4, D, Color
ZeigeWuerfel WPic, W5, E, Color
End Sub
Public Sub ZeigeWuerfel(Source As PictureBox, _
Ziel As PictureBox, Digit As Long, Color As Integer)
BitBlt Ziel.hDC, 0, 0, 32, 32, Source.hDC, 32 * (Color - 1), _
32 * (Digit - 1), SRCCOPY
Ziel.Refresh
End Sub
|
|