| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 823 人关注过本帖
标题:我的这段代码下标越界, 怎么回事?
取消只看楼主 加入收藏
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
快速回复:我的这段代码下标越界, 怎么回事?
数据加载中...
 
   



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

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