I'm trying to draw a simple rectangle with the following code :
...
this->Canvas->Pen->Color = TColor(0x00FFAAAA);
this->Canvas->Pen->Width = 1;
this->Canvas->Rectangle(0,0,this->Width, this->Height);
...
this works perfectly.
however, if for some reason i do not want to draw the rectangle border
but only the contents (the brush), i do :
...
//this->Canvas->Pen->Color = TColor(0x00FFAAAA);
this->Canvas->Pen->Width = 0;
this->Canvas->Rectangle(0,0,this->Width, this->Height);
...
but anyway, it draws the border...
where is the problem ?
thx.
RAF
this->Canvas->Pen->Style = psClear;
Eelke
Asger Jørgensen schrieb:
> In article <47049117$1...@newsgroups.borland.com>,
> Hi RAF
>
> nos...@noemail.com says...
>> Hi,
>>
>> this->Canvas->Pen->Width = 0;
>
> You don't need the this pointer
> You can write only:
>
> Canvas->Pen->Width = 0;
>
> Kind regards
> Asger
nos...@noemail.com says...
> Hi,
>
> this->Canvas->Pen->Width = 0;
You don't need the this pointer
You can write only:
Canvas->Pen->Width = 0;
Kind regards
Asger
> this->Canvas->Pen->Width = 0;
You can't set the Width below 1. This is stated in the TPen documentation:
"If Width is set to a value less than 1, the pen is given a Width of 1."
> but anyway, it draws the border...
Rectangle() is supposed to always draw a border. The TCanvas documentation
says as much:
"Use Rectangle to draw a rectangle using Pen and fill it with Brush...To
fill a rectangular region without drawing the boundary in the current pen,
use FillRect."
Gambit
> And is there a method to draw a 3D rectangle or should
> i play with lines, rectangle and fillrect ?
Look at the Frame3D() function.
Gambit