Hi WP,
Making transparent means "not filling the shape":
---------------------------------------------------------------------------
Transparent:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ColorBox;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormPaint(Sender: TObject);
begin
canvas.Brush.color:=clNone;
canvas.Brush.style:=bsClear;
canvas.pen.color:=clGreen;
Canvas.Rectangle(10,10,100,100);
Canvas.Rectangle(50,50,150,150);
end;
end.
---------------------------------------------------------------------------------
Filled:
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ColorBox;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormPaint(Sender: TObject);
begin
canvas.Brush.style:=bsClear;
Canvas.Brush.color:=clNone;
canvas.pen.color:=clGreen;
Canvas.Rectangle(10,10,100,100);
Canvas.Rectangle(50,50,150,150);
end;
end.
It is almost the same, just swapped the "canvas.brush.color:=clNone" and the "canvas.brush.style:=bsClear"
For some reason no program works on my raspberry pi to make a screenshot. I ll continue trying to make a screenshot and then come back.
When Canvas.Brush.color:=clNone comes before Canvas.Brush.style:=bsClear ; the rectangle is not filled, otherwise it is filled and in my example I don't see all the sides of the first rectangle.