Problem with FloodFill 
Author Message
 Problem with FloodFill

I'm trying to do the following thing:

There are two curves, either of which may be interrupted.  I need to
fill the region between them with color (wherever both curves are
continuous).  I have tried to use FloodFill or ExtFloodFill to do that.
I started off by closing the regions between the curves that need to be
filled, then located one point inside this area.  Then  

        CreateSolidBrush
           SelectObject(pictureBox.hdc,brush)
           Result=FloodFill(picturBox.hdc, X,Y, Color)
           Dim er As Long
           er=Err.LastDllError()

         the result is:
           Result=0
           er=0

No error occurs, but Result is always "0" and nothing happens.
If I try to draw a circle from that point, it works and that circle is
just inside that area.

The FloodFill function works fine in an independant program I obtained,
so I don't know what's the problem there.

--
-------------------------------------------------------------------
     "Me? Lady, I'm your worst nightmare - a pumpkin with a gun.
      [...] Euminides this! " - Mervyn, the Sandman #66
-------------------------------------------------------------------



Wed, 01 Dec 2004 03:49:05 GMT  
 Problem with FloodFill
Well you will need to have scalemode set to 3 (vbPixel) and have the
picturebox or whatever you are drawing into set to autoredraw = true. You
may also need to call the refresh method to see the outcome...
Try those for a start

Hoe this helps ;-)



Quote:
> I'm trying to do the following thing:

> There are two curves, either of which may be interrupted.  I need to
> fill the region between them with color (wherever both curves are
> continuous).  I have tried to use FloodFill or ExtFloodFill to do that.
> I started off by closing the regions between the curves that need to be
> filled, then located one point inside this area.  Then

> CreateSolidBrush
>    SelectObject(pictureBox.hdc,brush)
>    Result=FloodFill(picturBox.hdc, X,Y, Color)
>    Dim er As Long
>    er=Err.LastDllError()

> the result is:
>    Result=0
>        er=0

> No error occurs, but Result is always "0" and nothing happens.
> If I try to draw a circle from that point, it works and that circle is
> just inside that area.

> The FloodFill function works fine in an independant program I obtained,
> so I don't know what's the problem there.

> --
> -------------------------------------------------------------------
>      "Me? Lady, I'm your worst nightmare - a pumpkin with a gun.
>       [...] Euminides this! " - Mervyn, the Sandman #66
> -------------------------------------------------------------------



Wed, 01 Dec 2004 07:31:30 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. problem with floodfill and printer

2. problem with floodfill and printer

3. Problem with FloodFill

4. Floodfill problem still occurring

5. FloodFill problems....

6. FloodFill Problems in VB4.0

7. FloodFill problem

8. FloodFill

9. Help with FloodFill

10. How to use a special texture using FloodFill ?

11. FloodFill in image? - VB4 32bit

12. FloodFill in image? VB4 32bit

 

 
Powered by phpBB® Forum Software