Hi Jacob,
Here is the code you want.
If you know computer graphics, it is about BoundaryFill Algorithm that fills
a polygon. If you need any further code, just inform me. Thanks.

Public Sub BoundaryFill4(xf As Single, yf As Single, FillCol As ColorConstants, BoundaryCol As ColorConstants)



Dim current As ColorConstants

current = Point(xf, yf)



If ((current <> BoundaryCol) And (current <> FillCol)) Then

Me.PSet (xf, yf), FillCol

Call BoundaryFill4(xf + 1, yf, FillCol, BoundaryCol)

Call BoundaryFill4(xf - 1, yf, FillCol, BoundaryCol)

Call BoundaryFill4(xf, yf + 1, FillCol, BoundaryCol)

Call BoundaryFill4(xf, yf - 1, FillCol, BoundaryCol)

End If