Listing C


For IntegerXCounter = 0 To Width - 1
    For IntegerYCounter = 0 To Height - 1
        If BitmapText.GetPixel(IntegerXCounter, IntegerYCounter).A > 0 Then
            Continue For
        End If

        'Check left column
        IntegerXToCheck = Math.Max(IntegerXCounter - 1, 0)

        'Check up
        IntegerYToCheck = Math.Max(IntegerYCounter - 1, 0)

        If BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).A > 0 And BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).ToArgb <> IntegerHaloColorARGB Then
            BitmapText.SetPixel(IntegerXCounter, IntegerYCounter, HaloColor)
            Continue For
        End If

        'Check middle
        IntegerYToCheck = IntegerYCounter

        If BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).A > 0 And BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).ToArgb <> IntegerHaloColorARGB Then
            BitmapText.SetPixel(IntegerXCounter, IntegerYCounter, HaloColor)
            Continue For
        End If

        'Check bottom
        IntegerYToCheck = Math.Min(IntegerYCounter + 1, Height - 1)

        If BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).A > 0 And BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).ToArgb <> IntegerHaloColorARGB Then
            BitmapText.SetPixel(IntegerXCounter, IntegerYCounter, HaloColor)
            Continue For
        End If

        'Check middle column
        IntegerXToCheck = IntegerXCounter

        'Check up
        IntegerYToCheck = Math.Max(IntegerYCounter - 1, 0)

        If BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).A > 0 And BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).ToArgb <> IntegerHaloColorARGB Then
            BitmapText.SetPixel(IntegerXCounter, IntegerYCounter, HaloColor)
            Continue For
        End If

        'Check bottom
        IntegerYToCheck = Math.Min(IntegerYCounter + 1, Height - 1)

        If BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).A > 0 And BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).ToArgb <> IntegerHaloColorARGB Then
            BitmapText.SetPixel(IntegerXCounter, IntegerYCounter, HaloColor)
            Continue For
        End If

        'Check right column
        IntegerXToCheck = Math.Min(IntegerXCounter + 1, Width - 1)

        'Check up
        IntegerYToCheck = Math.Max(IntegerYCounter - 1, 0)

        If BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).A > 0 And BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).ToArgb <> IntegerHaloColorARGB Then
            BitmapText.SetPixel(IntegerXCounter, IntegerYCounter, HaloColor)
            Continue For
        End If

        'Check middle
        IntegerYToCheck = IntegerYCounter

            If BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).A > 0 And BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).ToArgb <> IntegerHaloColorARGB Then
            BitmapText.SetPixel(IntegerXCounter, IntegerYCounter, HaloColor)
            Continue For
        End If

        'Check bottom
        IntegerYToCheck = Math.Min(IntegerYCounter + 1, Height - 1)

        If BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).A > 0 And BitmapText.GetPixel(IntegerXToCheck, IntegerYToCheck).ToArgb <> IntegerHaloColorARGB Then
            BitmapText.SetPixel(IntegerXCounter, IntegerYCounter, HaloColor)
            Continue For
        End If
    Next
Next