标题:我的这段代码下标越界, 怎么回事?
取消只看楼主
lanhaihe99
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-3-17
 问题点数:0 回复次数:0 
我的这段代码下标越界, 怎么回事?
  Option Explicit
  Dim 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
是一段载入图象的代码.
搜索更多相关主题的帖子: 越界 代码 
2007-12-29 10:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-194950-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039527 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved