In regard to this question I have been able to create an FMX component that is a white rectangle with a black border that can be drawn inside with the cursor of the mouse (like with MS Paint).
When I compile and run the program I get this:
If I set the Align property for example it works (Client aligns this to client). If I align the component to Center it is on the center but the size is smaller (like in the picture).
It looks like it doesn’t “save” the width and the height that I set on the Object Inspector. My component has this relevant code:
Test = class(TControl)
procedure Paint; override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
And here’s the implementation:
constructor Test.Create(AOwner: TComponent);
FLineFill := TStrokeBrush.Create(TBrushKind.Solid, $FF222222);
Canvas.Stroke.Color := TAlphaColorRec.Black;
I have given a look at the source code of TPlotGrid which is a simple component and it does what I’m doing basically. Do I have to setup something more in the Paint event?