I have written a routine which should add a dotted border to a bitmap:
procedure AddDottedBorderToBitmap(aBM: Vcl.Graphics.TBitmap);
var
c: TCanvas;
begin
c := aBM.Canvas;
c.Pen.Color := clBlack;
c.Pen.Mode := pmXor;
c.Pen.Style := psDot;
c.MoveTo(0, 0);
c.LineTo(0, aBM.Height - 1);
c.LineTo(aBM.Width - 1, aBM.Height - 1);
c.LineTo(aBM.Width - 1, 0);
c.LineTo(0, 0);
end;
But when enlarging the result, the resulting borderline instead of dots seems to be made of small dashes:
Is this correct? If not, how can I get real dots instead of dashes?
DrawFocusRect it's a Windows API call that make a border like you need.
procedure AddDottedBorderToBitmap(aBM: Vcl.Graphics.TBitmap);
begin
DrawFocusRect(aBM.canvas.Handle,Rect(0,0,aBM.Width,aBM.Height));
end;