修改图片象素颜色出错,求教
程序如下,波浪线部分的出错提示是
“未处理的“System.ArgumentException”类型的异常出现在 system.drawing.dll 中
其他信息:使用了无效参数。
”
如何解决?
Dim bmpb As Bitmap
Dim bmpe As Bitmap
Dim bmpheght As Integer
Dim bmpw As Integer
Dim i, k, l As Integer
Dim cloAs
Dim a
bmpb = PictureBox1.Image.Clone
bmpe = PictureBox2.Image.Clone
For l = 0 To 6
'bmpb = bmpe
bmpheght = CType(bmpb.Height, Integer) '获得图片的高
bmpw = CType(bmpb.Width, Integer) '获得图片的宽
Button1.Text = bmpw '显示图片的宽
For i = 0 To bmpw - 1
For k = 0 To bmpheght - 1
cloAs = bmpb.GetPixel(i, k)
'获得象素点的颜色,返回颜色的16制代码
bmpe.SetPixel(i, k, cloAs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Next
Next
Next