Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get screen resolution in Firemonkey XE3?

How can I get the screen resolution in Firemonkey 2 (Delphi XE3)?

like image 849
Wayfer Avatar asked Oct 09 '12 17:10

Wayfer


1 Answers

It's all changed in XE3. The platform support has been completely overhauled. See Pawel Glowacki's article for more.

var
  ScreenSvc: IFMXScreenService;
  Size: TPointF;
begin
  if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, IInterface(ScreenSvc)) then
  begin
    Size := ScreenSvc.GetScreenSize;
    ....
  end;
end;

In spite of the overhaul, this is still not much use if you have multiple monitors. Perhaps there is some multimon support in FMX2, but it's clearly not available in IFMXScreenService.

like image 140
David Heffernan Avatar answered Nov 15 '22 03:11

David Heffernan