none
System.StackOverflowException类型的未经处理的异常 RRS feed

  • 问题

  • Public Structure Direction
            Public lypx As Integer
            Public lypy As Integer
    
            Public Sub New(ByVal _lypX As Integer, ByVal _lypY As Integer)
                lypx = _lypX : lypy = _lypY
            End Sub
        End Structure
    
        Sub PaintBucket(ByVal x As Integer, ByVal y As Integer, ByVal MyBitmap As Bitmap)
    
            Dim lypColor As Color = ColorDialog1.Color
    
            Dim NewColor As Color = Color.Black
            Dim i As Integer
            Dim lypDirection() As Direction = {New Direction(-1, 0), New Direction(0, 1), New Direction(1, 0), New Direction(0, -1)}
            If x < 472 And x > 0 And y > 0 And y < 477 Then
                If MyBitmap.GetPixel(x, y).R <> 255 Then
                    MyBitmap.SetPixel(x, y, Color.Yellow)
                    'MsgBox("lyp")
                    For i = 0 To 3 Step 1
                        PaintBucket(x + lypDirection(i).lypx, y + lypDirection(i).lypy, MyBitmap)
                    Next
                End If
    
            End If
        End Sub
    为什么会System.StackOverflowException??

    Visual Basic 初学者 望关照!

    2013年2月20日 14:10

答案

全部回复