Board index » delphi » bsSolid and Polygons

bsSolid and Polygons

I'm trying to show filled polygons that are solid. and cover up
anything beneath them.
Setting the canvas brush style to bsSolid works for Fillrect, but not
Polygon.

  C.Brush.Bitmap:= Nil;
  C.Brush.Color:= clLime;
  C.Brush.Style:= bsSolid;
  C.FillRect(Rect(100,100,200,200));

C.Polygon([Point(200,100),Point(300,100),Point(300,200),Point(200,200)]);

The Fillrect rectangle is solid, but the polygon rectangle is
transparent.

How do I get solid polygons?

TIA  Chuck

 

Re:bsSolid and Polygons


Hi Chuck,

I can't reproduce your problem neither in Delphi 1 nor in 3. Using your
code exactly I get two squares side by side. Unlike the FillRect the
Polygon has a frame with the pen's color.
The help says too a Polygon always is filled.

I know this won't help you very much but I can't see what should be
wrong with your sample.

Regards

Kerstin

Quote
Chuck Herndon wrote:

> I'm trying to show filled polygons that are solid. and cover up
> anything beneath them.
> Setting the canvas brush style to bsSolid works for Fillrect, but not
> Polygon.

>   C.Brush.Bitmap:= Nil;
>   C.Brush.Color:= clLime;
>   C.Brush.Style:= bsSolid;
>   C.FillRect(Rect(100,100,200,200));

>   C.Polygon([Point(200,100), Point(300,100), Point(300,200), Point(200,200)]);

> The Fillrect rectangle is solid, but the polygon rectangle is
> transparent.

> How do I get solid polygons?

> TIA  Chuck

Re:bsSolid and Polygons


On Sat, 20 Jun 1998 10:38:52 +0200, Kerstin Thaler

Quote
<muk.tha...@t-online.de> wrote:
>I can't reproduce your problem neither in Delphi 1 nor in 3. Using your
>code exactly I get two squares side by side. Unlike the FillRect the
>Polygon has a frame with the pen's color.
>The help says too a Polygon always is filled.

>I know this won't help you very much but I can't see what should be
>wrong with your sample.

Kerstin,

If you draw other things first, do both the fillrect and the polygon
cover up what's underneath them?

On my machine, the lines beneath the polygon still show up.

- Chuck

Quote

>Chuck Herndon wrote:

>> I'm trying to show filled polygons that are solid. and cover up
>> anything beneath them.
>> Setting the canvas brush style to bsSolid works for Fillrect, but not
>> Polygon.

>>   C.Brush.Bitmap:= Nil;
>>   C.Brush.Color:= clLime;
>>   C.Brush.Style:= bsSolid;
>>   C.FillRect(Rect(100,100,200,200));

>>   C.Polygon([Point(200,100), Point(300,100), Point(300,200), Point(200,200)]);

>> The Fillrect rectangle is solid, but the polygon rectangle is
>> transparent.

>> How do I get solid polygons?

>> TIA  Chuck

Re:bsSolid and Polygons


On Sat, 20 Jun 1998 10:38:52 +0200, Kerstin Thaler

Quote
<muk.tha...@t-online.de> wrote:
>I know this won't help you very much but I can't see what should be
>wrong with your sample.

Kerstin,

Thanks. I found it.
There were two drawing processes going on allowing movement of the
polygons, and the code I showed you didn't get run when it was
supposed to.

Quote

>Chuck Herndon wrote:

>> I'm trying to show filled polygons that are solid. and cover up
>> anything beneath them.
>> Setting the canvas brush style to bsSolid works for Fillrect, but not
>> Polygon.

>>   C.Brush.Bitmap:= Nil;
>>   C.Brush.Color:= clLime;
>>   C.Brush.Style:= bsSolid;
>>   C.FillRect(Rect(100,100,200,200));

>>   C.Polygon([Point(200,100), Point(300,100), Point(300,200), Point(200,200)]);

>> The Fillrect rectangle is solid, but the polygon rectangle is
>> transparent.

>> How do I get solid polygons?

>> TIA  Chuck

Other Threads