problem with floodfill and printer 
Author Message
 problem with floodfill and printer

Help! I'm trying to fill in a shape on the printer and am having
difficulty getting FloodFill or ExtFloodFill to work. If I run the
following code I get a box but it isn't filled in red like it should be.
What am I doing wrong? I need to use some sort of flood fill. I cannot
use polygon or perform the fill with the line method because in my full
program I have no idea what the shape is going to look like in advance.
btw: the value of Suc% I am getting returned is zero. The box is drawn
fine but is not filled in.

Thanx

dave

code snippet......
Printer.FillStyle = 1
    Printer.Line (1000, 1000)-(3000, 3000), , B
    Printer.FillStyle = 0
    Printer.FillColor = RGB(230, 0, 0)
    Suc% = ExtFloodFill(Printer.hdc, 1500 / Printer.TwipsPerPixelX, 1500
/ Printer.TwipsPerPixelY, 0, 0)
    Printer.EndDoc



Sun, 30 Sep 2001 03:00:00 GMT  
 problem with floodfill and printer
I haven't used ExtFloodFill before but...here's what D. Appleman says:

Declare Function ExtFloodFill& Lib "gdi32" (ByVal hdc As Long, ByVal x As
Long, _
ByVal y As Long, ByVal crColor As Long, ByVal wFillType As Long)

wFillType Long-Type of filling to perform based on one of the following
constants:
FLOODFILLBORDER: Same as performed by the FloodFill function.
FLOODFILLSURFACE: Fills outward from the specified point as long as color
crColor is found (use if the border is more than one color).

1) Use the GetDeviceCaps function to determine if the device supports this
function.
2) Instead of using CrColor=0&, use crColor=vbblack 'or whatever color you
used for the bounds
3) Point X,Y must not have color crColor, and must be within the clipping
region. This function only works on raster devices.
4) Suc must be LONG!... if you are under #Win32

nice function! I have never encountered it before...

Hope this helps,
Aris.

Quote:
> Printer.FillStyle = 1
>     Printer.Line (1000, 1000)-(3000, 3000), , B
>     Printer.FillStyle = 0
>     Printer.FillColor = RGB(230, 0, 0)
>     Suc% = ExtFloodFill(Printer.hdc, 1500 / Printer.TwipsPerPixelX, 1500
> / Printer.TwipsPerPixelY, 0, 0)
>     Printer.EndDoc



Fri, 05 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. problem with floodfill and printer

2. Equivalent of FloodFill for Printers

3. FLOODFILL on a printer example wanted !

4. Floodfill on a printer

5. Floodfill for Printer Object

6. Floodfill problem still occurring

7. Problem with FloodFill

8. FloodFill problems....

9. FloodFill Problems in VB4.0

10. FloodFill problem

11. Problem with FloodFill

12. Problem setting the active printer of Word 97 without changing the Windows default printer

 

 
Powered by phpBB® Forum Software