Registriert seit: 19. Mai 2006
570 Beiträge
Delphi XE3 Professional
|
AW: [FMX] Screenauflösung und Monitore
25. Okt 2013, 21:35
Delphi-Quellcode:
uses
FMX.Forms, FMX.Platform;
type
TScreenHelper = class helper for TScreen
private
function GetHeight: Single;
function GetSize: TSizeF;
function GetWidth: Single;
public
property Height: Single read GetHeight;
property Size: TSizeF read GetSize;
property Width: Single read GetWidth;
end;
function TScreenHelper.GetHeight: Single;
begin
Result:=Size.cy;
end;
function TScreenHelper.GetSize: TSizeF;
var
ScreenService: IFMXScreenService;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService,IInterface(ScreenService))
then Result:=ScreenService.GetScreenSize
else Result:=TPointF.Create(0,0);
end;
function TScreenHelper.GetWidth: Single;
begin
Result:=Size.cx;
end;
Geändert von Thom (25. Okt 2013 um 21:38 Uhr)
|