Hola a todos.
He empezado una nueva aplicación con Delphi 10 para la tablet Surface Pro y no consigo detectar si la tablet está en modo "portrait" o "Landscape". He probado varios ejemplo de código pero siempre me detecta la pantalla en modo Landscape.
El código está dentro de un timer:
Código Delphi
[-]
procedure TForm1.Timer1Timer(Sender: TObject);
var
ScreenService: IFMXScreenService;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, IInterface(ScreenService)) then
begin
if ScreenService.GetScreenOrientation in [TScreenOrientation.soPortrait, TScreenOrientation.soInvertedPortrait] then
edit1.Text:=('Portrait Orientation')
else
edit1.Text:=('Landscape Orientation');
end;
Todos los ejemplos que encuentro son para IOS o Android. ¿Alguna idea?
Gracias