I simply can't figure out what I'm doing wrong when trying to paint a control.
I've tried using TCanvas.BeginScene()/TCanvas.EndScene(), tried painting in other methods (for example main form OnPaint()).
I've tried TControl.InvalidateRect().
I get nothing.
Here's what I have in my test app:
type
TTestControl = class(TControl)
protected
procedure Paint; override;
end;
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
fTestControl: TTestControl;
end;
procedure TTestControl.Paint;
begin
Canvas.Fill.Color := TColorRec.Blueviolet;
Canvas.FillEllipse(ClipRect, AbsoluteOpacity);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
fTestControl := TTestControl.Create(Self);
fTestControl.Parent := Self;
fTestControl.Align := TAlignLayout.Client;
end;
It ought to be enough, according to what's online.
Any suggestions?