Board index » cppbuilder » Problem with TPrinter->Canvas->Polygon

Problem with TPrinter->Canvas->Polygon

Hi,

a friend of mine is playing around with printing some simple graphics.
He wrote the following code (snippet):

  POINT p[4];
  p[0] = Point(0,0);
  p[1] = Point(300,0);
  p[2] = Point(300,300);
  p[3] = Point(0,300);
  TPrinter* p = Printer();
  p->BeginDoc();
  p->Canvas->Brush->Color = clBlack;
  p->Canvas->Brush->Style = bsBDiagonal;
  p->Canvas->Polygon(p,4);
  p->EndDoc();
He told me that under Win98 this works ok, but under WinNT a black
square with solid filling is printed. Well, when I execute this code on
my NT machine, only a black square without any filling is printed. I
never dealt with printing, so I don't have any clue what's wrong here.

Thanks for any help.

Martin Golm
Reico GmbH

 

Re:Problem with TPrinter->Canvas->Polygon


I can only suggest messing with the GetDeviceCaps() API function to see if
some features are not supported by the different printer drivers...

Other Threads