Board index » cppbuilder » FloodFill in Printer()->Canvas

FloodFill in Printer()->Canvas

Hi,
Passing my Printer()->Canvas  to my various drawing functions, the
FloodFill not works (Works fine on others canvas). Is any other way to
do the same.
FillRect, FillPoly, etc. are not exactly what I need. Of course, if
anyone have a suggestion to fill perfectly a region which is a kind of
open polygon which is close with a PolyBezier curve.
Regards,
Rene Wilhelmy
Montreal
 

Re:FloodFill in Printer()->Canvas


Could be that your printer doesn't support FloodFill.
Check GetDeviceCaps()

Best regards Jeppe
Cramon Utilities
http://www.cramon.dk

Quote
<r...@colba.net> wrote in message news:38CFA088.D6686628@colba.net...
> Hi,
> Passing my Printer()->Canvas  to my various drawing functions, the
> FloodFill not works (Works fine on others canvas). Is any other way to
> do the same.
> FillRect, FillPoly, etc. are not exactly what I need. Of course, if
> anyone have a suggestion to fill perfectly a region which is a kind of
> open polygon which is close with a PolyBezier curve.
> Regards,
> Rene Wilhelmy
> Montreal

Re:FloodFill in Printer()->Canvas


Hi Rene,

Quote
> Passing my Printer()->Canvas  to my various drawing functions, the
> FloodFill not works (Works fine on others canvas). Is any other way to
> do the same.

Go through an intermediate bitmap, before rendering to the printer.
That is, pass the Canvas of a TBitmap into your drawing functions,
convert this bitmap to a DIB, then send the bitmap to the printer via
the StretchDIBits() API function
[http://bcbcaq.freeservers.com/print_graphics.html].  Joe C. Hecht's
TExcellent*Printer line of components is your best bet for this...

http://home1.gte.net/joehecht/index.htm

Quote
> FillRect, FillPoly, etc. are not exactly what I need. Of course, if
> anyone have a suggestion to fill perfectly a region which is a kind of
> open polygon which is close with a PolyBezier curve.

Convert your shape to a region, then use the FillRgn() GDI function.

Good luck!

--
Damon Chandler
http://bcbcaq.freeservers.com

Re:FloodFill in Printer()->Canvas


Hi Damon,

I tried the Bitmap way, but it's much much more long to do the task, because
the true size of the printing canvas is very big. Also, I can't do in one
shot because of course the size of the bitmap is huge. But it's true that
this way can work ok with a lot of section bitmap manipulation.
Unfortunatly, if I use a smaller bitmap and print via the StretchDIBits()
function, the drawing lost too much precision.
I'll try on the FillRgn()  solution...
Thanks again Damon,
Rene Wilhelmy

Quote
Damon Chandler wrote:
> Hi Rene,
> > Passing my Printer()->Canvas  to my various drawing functions, the
> > FloodFill not works (Works fine on others canvas). Is any other way to
> > do the same.

Other Threads