amtek
August 5th, 1999, 04:50 AM
I am trying to print a filled bounded area using the printer object. See code below:
Printer.ForeColor = vbBlack ' Set draw line to black.
Printer.Line (1000, 500)-(3000, 500) ' Draw a triangle.
Printer.Line -(2000, 2000)
Printer.Line -(1000, 500)
Printer.FillStyle = vbFSSolid ' Set FillStyle to solid.
Printer.FillColor = RGB(128, 128, 255) ' Set FillColor.
' Call Windows API to fill.
FloodFill Printer.hDC, 2000, 1000, Printer.ForeColor
Printer.EndDoc
'The floodfill API function must be declared
Declare Sub FloodFill Lib "GDI32" _
(ByVal hDC As Long, ByVal X As Long, ByVal Y As _
Long, ByVal crColor As Long)
Unfortunately the printout shows only an unfilled rectangle. Using floodfill on the screen works fine.
I would greatly appreciate a solution to my problem.
/Anders
Printer.ForeColor = vbBlack ' Set draw line to black.
Printer.Line (1000, 500)-(3000, 500) ' Draw a triangle.
Printer.Line -(2000, 2000)
Printer.Line -(1000, 500)
Printer.FillStyle = vbFSSolid ' Set FillStyle to solid.
Printer.FillColor = RGB(128, 128, 255) ' Set FillColor.
' Call Windows API to fill.
FloodFill Printer.hDC, 2000, 1000, Printer.ForeColor
Printer.EndDoc
'The floodfill API function must be declared
Declare Sub FloodFill Lib "GDI32" _
(ByVal hDC As Long, ByVal X As Long, ByVal Y As _
Long, ByVal crColor As Long)
Unfortunately the printout shows only an unfilled rectangle. Using floodfill on the screen works fine.
I would greatly appreciate a solution to my problem.
/Anders