Board index » cppbuilder » Canvas->Pen->Style = psDash

Canvas->Pen->Style = psDash


2006-11-21 09:36:59 PM
cppbuilder101
Is there something required in addition to the following to get a dashed
line?
pCanvas->Pen->Style = psDash;
pCanvas->Pen->Width = 4;
pCanvas->Pen->Color = clRed;
pCanvas->MoveTo(0,0);
pCanvas->LineTo(Image->ClientRect.right,Image->ClientRect.Bottom);
All I get is a solid line.
I am using C++ Builder 6.
Thanks,
Roger
 
 

Re:Canvas->Pen->Style = psDash

From MSDN
Pen is dashed. This style is valid only when the pen width is one or less in
device units.
"Roger" < XXXX@XXXXX.COM >ha scritto nel messaggio
Quote
Is there something required in addition to the following to get a dashed
line?

pCanvas->Pen->Style = psDash;
pCanvas->Pen->Width = 4;
pCanvas->Pen->Color = clRed;
pCanvas->MoveTo(0,0);
pCanvas->LineTo(Image->ClientRect.right,Image->ClientRect.Bottom);

All I get is a solid line.

I am using C++ Builder 6.

Thanks,
Roger

 

Re:Canvas->Pen->Style = psDash

Quote

Pen is dashed. This style is valid only when the pen width is one or less
in device units.

Thanks, I also noticed that the Brush->Color can not be the same as
Pen->Color.
 

{smallsort}

Re:Canvas->Pen->Style = psDash

"Roger" < XXXX@XXXXX.COM >wrote in message
Quote

Thanks, I also noticed that the Brush->Color can not be the same as
Pen->Color.

The sections of dashed lines alternate between the Pen and Brush attributes
so, if they're the same color and the brush is solid, the line will not
appear to be dashed.
HTH,
Geordie
p.s. Once accepted, I don't have a problem with this, but the inability to
have broad dashed lines is a real pain!