function GetAdjustedLocation: TFloatRect;
When the Scaled property is True, GetAdjustedLocation returns scaled Location, otherwise it returns Location as it is, without scaling.
It is up to you do decide if you want to use the result as a floating-point rectangle, to round the coordinates before painting:
procedure TForm1.OnLayerPaintHandler(Sender: TObject; Buffer: TBitmap32);
var
R: TRect;
begin
if Sender is TPositionedLayer then
with TPositionedLayer(Sender) do
begin
R := MakeRect(GetAdjustedLocation);
Buffer.FrameRectS(R.Left, R.Top, R.Right, R.Bottom, clRed32);
end;
end;
end;
Using Layers, Rectangle Types, GetAdjustedRect, Location, Scaled
Copyright ©2000-2024 Alex Denisov and the Graphics32 Team - Graphics32 2.0 - Help file built on 18 Feb 2024