Board index » cppbuilder » Printing different brush Styles

Printing different brush Styles

I have a CAD application which fills various regions with colors and various brush styles.  The code that I use to print my canvas
is

         PRCanvas->Brush->Style = pattern;
          PRCanvas->Brush->Color = color;
         PRCanvas->Polygon(Points, nr);
where pattern is one of the standard brush styles (bsSolid, bsDiagCross, etc), color is (obviously) a color, Points is an array of
TPoint's which defines the polygon to be filled.  PRCanvas is the printer canvas

This works just fine for all printers I have tried EXCEPT for HP printers under Windows 2000 and Windows XP.  It works fine for HP
printers under Windows 98.  Is this the wrong way to fill a polygon?

--
Wojciech Komornicki

 

Re:Printing different brush Styles


You are lucky it works at all. Patterns made from 8 by 8 pixel blocks
are generally not visible at high resolutions (they turn into blobs). Some
drivers compensate for this, but they are vary few and far between...

Kinda reminds me of the guy that used a pen with a 1 pixel width
on a 3500 DPI film device, then complaind that the lines did not
image. "Sure they did"... I pulled out a very powerfull magnifyer
and showed him his lines where precisly 1/3500th of an inch wide!

Joe
--
Delphi, graphics, and printing specialist available - $35/hr
http://www.code4sale.com/codeit/index.htm

Quote
"Wojciech Komornicki" <wkomorni...@hotmail.com> wrote in message news:3d3b0a92$1_1@dnews...
> I have a CAD application which fills various regions with colors and various brush styles.  The code that I use to print my canvas
> is

>          PRCanvas->Brush->Style = pattern;
>           PRCanvas->Brush->Color = color;
>          PRCanvas->Polygon(Points, nr);
> where pattern is one of the standard brush styles (bsSolid, bsDiagCross, etc), color is (obviously) a color, Points is an array of
> TPoint's which defines the polygon to be filled.  PRCanvas is the printer canvas

> This works just fine for all printers I have tried EXCEPT for HP printers under Windows 2000 and Windows XP.  It works fine for HP
> printers under Windows 98.  Is this the wrong way to fill a polygon?

> --
> Wojciech Komornicki

Re:Printing different brush Styles


Here is some more info on the following question which I had posed.
When I replace the code below by direct calls to the Windows API (i.e,
create my own brushes, regions, and call FillRgn) the code works on all of
the printers I have.

Though I know of packages which will allow me "to do the right thing" (for
example Joe Hecht seems to have a nice package) I am looking for an answer
as to whether there is a problem in the HP drivers, in the C++Builder
implementation or whether it is my code.  Just doing something a different
way does not teach one what is wrong with a particular method.
--
Wojciech Komornicki

Quote
"Wojciech Komornicki" <wkomorni...@hotmail.com> wrote in message

news:3d3b0a92$1_1@dnews...
Quote
> I have a CAD application which fills various regions with colors and

various brush styles.  The code that I use to print my canvas
Quote
> is

>          PRCanvas->Brush->Style = pattern;
>           PRCanvas->Brush->Color = color;
>          PRCanvas->Polygon(Points, nr);
> where pattern is one of the standard brush styles (bsSolid, bsDiagCross,

etc), color is (obviously) a color, Points is an array of
Quote
> TPoint's which defines the polygon to be filled.  PRCanvas is the printer
canvas

> This works just fine for all printers I have tried EXCEPT for HP printers

under Windows 2000 and Windows XP.  It works fine for HP
Quote
> printers under Windows 98.  Is this the wrong way to fill a polygon?

> --
> Wojciech Komornicki

Other Threads