Delphi-Quellcode:
procedure TForm3.FormPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF);
var
Angle: Single;
Matrix: TMatrix;
begin
Canvas.Fill.Color := TAlphaColors.Black;
Angle := -ArcTan2(ClientHeight, ClientWidth);
Matrix := Canvas.Matrix.CreateRotation(Angle);
Canvas.SetMatrix(Matrix);
Canvas.FillText(ClientRect, 'Rotated FMX Text', False, 1, [], TTextAlign.Leading, TTextAlign.Trailing);
Hatte hier als Winkel zuerst 0.3 probiert, aber war nix zu sehn.
Delphi-Quellcode:
Canvas.Fill.Color := TAlphaColors.Black;
Canvas.SetMatrix(Canvas.Matrix.CreateRotation(-0.64));
Canvas.FillText(ClientRect, 'Rotated FMX Text', False, 1, [], TTextAlign.Leading, TTextAlign.Trailing);
Ja, das Erste berechnet auch einen negativen Winkel und der liegt innerhalb des Canvas-Rechtecks.
Wie bei drawRotatedText muß man also noch das X:Y dazurechnen,
bzw. das RectF für FillText ordentlich befüllen.
Ein Therapeut entspricht 1024 Gigapeut.