我试图通过计算我编写代码的blob中每行的白色像素数来找到blob的最大宽度,但是,它永远不会停止。如何解决?
For y = 0 To bmp.ScaleHeight - 1
sum = 0
For x = 0 To bmp.ScaleWidth - 1
pixel1 = bmp.Point(x, y)
If pixel1 = vbWhite Then
sum = sum + 1
If bmp.Point(x + 1, y) = vbBlack Then
If sum > max Then
Lmax = sum
y1 = y
x2 = x
x1 = x2 - sum
End If
End If
End If
Next x
Next y