Board index » delphi » Pen instead of Brush.

Pen instead of Brush.

How can I create a filled rectangle with a pen style and mode right now I do
this...

  Canvas.Pen.Color := Color;
  Canvas.Pen.Style := psSolid;
  Canvas.Pen.Mode := pmMask;
  Canvas.Pen.Width := 1;
  for j := BorderWidth to Height-BorderWidth do    // Iterate
   begin
    Canvas.MoveTo(BorderWidth,j);
    Canvas.LineTo(Width-BorderWidth,j);
   end;    // for

Is there a more efficient way of do this?

Please note that I want to use the pen and not the brush to accomplish this
as the pen mode is set to a mode I want to use.   So using FillRect and
Rectangle methods of Canvas object will not work as it uses the Brush to
fill the inside part of the rectangle.

Davinci

 

Re:Pen instead of Brush.


Quote
Davinci Jeremie wrote in message <7qoh9p$i...@forums.borland.com>...
>How can I create a filled rectangle with a pen style and mode right now I
do
>this...

>  Canvas.Pen.Color := Color;
>  Canvas.Pen.Style := psSolid;
>  Canvas.Pen.Mode := pmMask;
>  Canvas.Pen.Width := 1;
>  for j := BorderWidth to Height-BorderWidth do    // Iterate
>   begin
>    Canvas.MoveTo(BorderWidth,j);
>    Canvas.LineTo(Width-BorderWidth,j);
>   end;    // for

>Is there a more efficient way of do this?

>Please note that I want to use the pen and not the brush to accomplish this
>as the pen mode is set to a mode I want to use.   So using FillRect and
>Rectangle methods of Canvas object will not work as it uses the Brush to
>fill the inside part of the rectangle.

>Davinci

Why not try create your favoriated brush style to fill rectangle?

Re:Pen instead of Brush.


I don't understand what do you mean by "favoriated brush style"?
Quote
ewpsi wrote in message <7qsh6i$lt...@forums.borland.com>...

>Why not try create your favoriated brush style to fill rectangle?

Other Threads