NowHeight = 16
NowWidth = 30
TotMine = 40
Picture1.Height = (image1(0).Height) * NowHeight
Picture1.Width = (image1(0).Width) * NowWidth
Picture1.ScaleMode = 3
Picture1.ScaleHeight = NowHeight
Picture1.ScaleWidth = NowWidth
For X = 0 To NowWidth - 1
For Y = 0 To NowHeight - 1
Picture1.PaintPicture image1(9).Picture, X, Y
Next
Next
ClearStart NowWidth, NowHeight, TotMine
WriteNumber NowWidth, NowHeight
Exit Sub
''--------------------------
For X = 1 To NowWidth
For Y = 1 To NowHeight
If What(X, Y) = 10 Then
Picture1.PaintPicture image1(13).Picture, X - 1, Y - 1
ElseIf What(X, Y) >= 1 And What(X, Y) <= 9 Then
Picture1.PaintPicture image1(What(X, Y)).Picture, X - 1, Y - 1
Else
Picture1.PaintPicture image1(9).Picture, X - 1, Y - 1
End If
Next
Next
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Dim T As Long
Dim X1 As Long
Dim Y1 As Long
Dim x2 As Single
Dim y2 As Single
mX = Int(X)
mY = Int(Y)
If Button = vbLeftButton Then
''左键按下
If What(mX + 1, mY + 1) >= 0 And What(mX + 1, mY + 1) <= 10 Then
Picture1.PaintPicture image1(14).Picture, mX, mY
End If
ElseIf Button = vbRightButton Then
''右键按下
''只有是打开的才处理
If What(mX + 1, mY + 1) >= -9 And What(mX + 1, mY + 1) <= -1 Then
T = 0
''计算标记的雷
For X1 = mX To mX + 2
For Y1 = mY To mY + 2
If X1 = mX + 1 And Y1 = mY + 1 Then
Else
If X1 >= 1 And X1 <= NowWidth Then
If Y1 >= 1 And Y1 <= NowHeight Then
If What(X1, Y1) = 13 Then
T = T + 1
End If
End If
End If
&nbs