Note it runs slow, but I believe this has more to do with the fact that it uses PSet and Point (rather than getting an array of pixels using GetDibBits and then operating on the array) than it does with some inherant slowness of the algorithm. The algorithm uses a stack (albeit a simulated one with a Long array and a separate Long variable for the stack pointer, not the real stack and pointer that you can directly access if you know assembly language) to store points to check to see if they are clear (equal to RefCol, the reference color), and thus to be filled in with a fill color (FillCol) which is generated randomly at the start of the FloodFill operation (and is always guarantied to not be the same as RefCol, because of how it is picked).

Here is the code for Module1
Code:
Dim Stack(10000000 - 1) As Long
Public SP As Long

Public Sub Push(ByVal Value As Long)
SP = SP + 1
Stack(SP) = Value
End Sub

Public Sub Pop(ByRef Value As Long)
Value = Stack(SP)
SP = SP - 1
End Sub
And here is the code for Form1
Code:
Private Sub Form_Load()
Randomize
SP = -1
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button <> 1 Then Exit Sub
If Check1.Value Then FloodFill X, Y Else PSet (X, Y)
End Sub

Public Sub FloodFill(ByVal X0 As Long, ByVal Y0 As Long)
Dim X As Long
Dim Y As Long
Dim n As Long
Dim RefCol As Long
Dim FillCol As Long

RefCol = Me.Point(X0, Y0)
Do
    FillCol = RGB(Int(Rnd * 256), Int(Rnd * 256), Int(Rnd * 256))
Loop Until FillCol <> RefCol

Push Y0
Push X0


Do Until SP = -1
    Pop X
    Pop Y
    If Point(X, Y) = RefCol Then
        PSet (X, Y), FillCol
        n = n + 1
        If n Mod 10000 = 0 Then
            Refresh
            If n Mod 100000 = 0 Then DoEvents
        End If
        If Point(X, Y - 1) = RefCol Then
            Push Y - 1
            Push X
        End If
        If Point(X, Y + 1) = RefCol Then
            Push Y + 1
            Push X
        End If
        If Point(X - 1, Y) = RefCol Then
            Push Y
            Push X - 1
        End If
        If Point(X + 1, Y) = RefCol Then
            Push Y
            Push X + 1
        End If
    End If
Loop
Form1.Caption = n
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button = 1) And (Check1.Value = 0) Then Line -(X, Y)
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button = 1) And (Check1.Value = 0) Then PSet (X, Y)
End Sub
The only things you need to do to Form1 to make this work are add a checkbox control, change the form's ScaleMode to Pixel, and change the form's AutoRedraw property to True.

Draw shapes with the checkbox unchecked, and then click inside the shapes you draw after making the checkbox checked, to fill the shapes you have drawn.