循环问题
Private Sub Calculate_Click()
Dim i As Long
Dim x As Long
Dim y As Long
Dim z As Long
Dim num As Long
Dim Row As Long
Dim s As String
Dim J As Integer
num = 0
i = 0
Dim dian As Long
Row = 16 * Page '总行数
dian = Row * 128 '所有点数
'ReDim ardata((Row + 1) * 128) '重定义总点数
ReDim ardata(dian)
For y = 0 To (Row - 1)
For x = 0 To 127
For J = 0 To Page - 1
'为什么这个循环只执行了最后一个,如果page-1=5,那么z=Picture1(5).Point(x,y),其他不执行
z = Picture1(J).Point(x, y)
Next
ardata(i) = z
' s$ = s$ & " " & ardata(i)
i = i + 1
num = num + 1
Next
Next
'Text1.Text = s$
'Debug.Print num
End Sub
问题就出现在中间那个为什么。
[解决办法]
单步调试看下值
[解决办法]
看你的意思是一页一页改变LCD显示,代码循环修改如下:
For J = 0 To page - 1
For y = 0 To (Row - 1)
For x = 0 To 127
z = Picture1(J).Point(x, y)
Next
ardata(i) = z
s$ = s$ & " " & ardata(i)
i = i + 1
num = num + 1
Next
Next