如何使用FiremonkeyFM³获得屏幕尺寸?如下代码:

var
  Size: TPointF;
begin
  Size := FMX.Platform.IFMXScreenService.GetScreenSize;
  ...
end;

导致此编译器错误的结果:

[dcc32 Error] Unit1.pas(46): E2018 Record, object or class type required

我应该如何使用IFMXScreenService接口(interface)获取屏幕尺寸?

最佳答案

尝试这个 :

var
  ScreenSize: TSize;
begin
  ScreenSize := Screen.Size;
  Caption := IntToStr(ScreenSize.Width) + '*' + IntToStr(ScreenSize.Height);
end;

10-08 05:21