急求用VISUAL BASIC 绘制中国象棋棋盘源代码!十万火急~
发布网友
发布时间:2022-04-24 16:08
我来回答
共3个回答
热心网友
时间:2022-04-24 17:37
是这样子吧
热心网友
时间:2022-04-24 18:55
'不知道这个可以不可以
Private Const BORDERSIZE = 80
Private Sub Form_Paint()
Dim w As Long
Dim h As Long
Dim m As Long
Dim x As Long
Dim y As Long
Dim i As Long
Dim c As Long
Me.Cls
c = BORDERSIZE / 2
w = Me.ScaleWidth - BORDERSIZE * 2
h = Me.ScaleHeight - BORDERSIZE * 2
x = BORDERSIZE
y = BORDERSIZE
If w / 8 < h / 9 Then
m = w / 8
Else
m = h / 9
End If
For i = 0 To 9
Me.Line (x, y + m * i)-(x + m * 8, y + m * i)
Next i
Me.Line (x, y)-(x, y + m * 9)
Me.Line (x + m * 8, y)-(x + m * 8, y + m * 9)
For i = 1 To 7
Me.Line (x + m * i, y)-(x + m * i, y + m * 4)
Me.Line (x + m * i, y + m * 5)-(x + m * i, y + m * 9)
Next i
Me.Line (x - c, y - c)-(x - c, y + c + m * 9)
Me.Line (x - c, y - c)-(x + c + m * 8, y - c)
Me.Line (x - c, y + c + m * 9)-(x + c + m * 8, y + c + m * 9)
Me.Line (x + c + m * 8, y - c)-(x + c + m * 8, y + c + m * 9)
Me.Line (x + m * 3, y)-(x + m * 5, y + m * 2)
Me.Line (x + m * 5, y)-(x + m * 3, y + m * 2)
Me.Line (x + m * 3, y + m * 7)-(x + m * 5, y + m * 9)
Me.Line (x + m * 5, y + m * 7)-(x + m * 3, y + m * 9)
End Sub
Private Sub Form_Resize()
Call Form_Paint
End Sub
热心网友
时间:2022-04-24 20:30
有问题问百度。。。