[求助]可以用图形表示一个矩阵吗?
我想问的是用VB可以实现下面的功能吗?就是给出一个距阵,比如:[0 0 0 1 0 1 1
1 0 1 1 0 0 0
0 1 1 0 0 0 0
1 1 0 0 0 0 0]
用图形表示出来,就是当遇到0的时候就用白点表示,当遇到"1"的时候就用黑点表示出来.是不是用print实
现的,具体怎么实现的啊?
小弟我实在对VB不懂,还望各位大侠多多指教呀!
Option Explicit
Private Sub Command1_Click()
Me.BackColor = vbWhite
Dim i As Integer, j As Integer
Dim a(1 To 5, 1 To 5) As Integer
For i = 1 To 5
For j = 1 To 5
a(i, j) = Int(Rnd * 2)
Next
Next
For i = 1 To 5
For j = 1 To 5
If a(i, j) = 1 Then
Me.ForeColor = vbBlack
Print a(i, j);
Else
Me.ForeColor = vbBlue
Print a(i, j);
End If
Next
Print
Next
End Sub