Ver Mensaje Individual
  #1  
Antiguo 26-11-2018
HccSoft HccSoft is offline
Miembro
 
Registrado: may 2006
Posts: 14
Reputación: 0
HccSoft Va por buen camino
Orientación de la pantalla en Windows 10 con una Surface

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
Responder Con Cita