我的这段代码下标越界, 怎么回事?
Option ExplicitDim imagepixels(2,1024,1024) As Integer
Dim x As Integer, y As Integer, filename As String
Dim pixel
Private Sub Loadin_Click()
Dim red As Long, green As Long, blue As Long
Dim i, j
filename = InputBox("输入文件名")
Picture1 = LoadPicture(filename)
x = Picture1.ScaleWidth: y = Picture2.ScaleHeight
For i = 0 To y - 1
For j = 0 To x - 1
pixel = Form1.Picture1.Point(j, i)
red = pixel Mod 256&
green = ((pixel And &HFF00) / 256&) Mod 256&
blue = (pixel / &H10000)
imagepixels(0, j, i) = red: imagepixels(1, j, i) = green: imagepixels(2,
j, i) = blue
Next j: Next i
End Sub
是一段载入图象的代码.