这段代码总是通过算术溢出异常。怎么了 ?
Function ChannelSum(ByVal C As System.Drawing.Color) As Integer
Dim temp As Integer : temp = (C.R + C.G + C.B)
Return temp
End Function
...
Dim x, y, R, G, B, a As Integer : Dim tmp As Color
bmp = New Bitmap(picBox.Tag.ToString)
xMax = bmp.Width - 1 : yMax = bmp.Height - 1
For x = 0 To xMax Step 1
For y = 0 To yMax Step 1
tmp = bmp.GetPixel(x, y) : a = ChannelSum(tmp)
Next y
Next x
循环在第一次相遇时中断!