Hi, try this code on Windows:
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
PaintBox1.Canvas.Pen.Width:=2;
PaintBox1.Canvas.Rectangle(0, 0, PaintBox1.Width, PaintBox1.Height);
end;
You will notice that the top and left borders has 1px wide only, instead of 2.
Also try this:
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
PaintBox1.Canvas.Pen.Width:=2;
PaintBox1.Canvas.Rectangle(1, 1, PaintBox1.Width, PaintBox1.Height);
end;
This fixes the width, but there are 2 missing pixels, at the top left and top right.
Tested on Windows 10.
There are more properties I need to set to get a proper drawing? (I mean 2px width in each border, without missing pixels).
Thanks
Edit: On Delphi I get the first test the same (missing 1px at left and top), and the second is without missing pixels (the output is the desired).