Created
January 25, 2024 16:03
-
-
Save an01f01/828c791dc18e161e183889d0eae0b5fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ Screen Scaling for Device } | |
function GetScreenScale: Single; | |
var | |
ScreenService: IFMXScreenService; | |
begin | |
Result := 1; | |
if TPlatformServices.Current.SupportsPlatformService (IFMXScreenService, IInterface(ScreenService)) then | |
begin | |
Result := ScreenService.GetScreenScale; | |
end; | |
end; | |
{ Screen Size for Device } | |
function GetScreenSize: TPointF; | |
var | |
ScreenService: IFMXScreenService; | |
begin | |
Result := TPointF.Zero; | |
if TPlatformServices.Current.SupportsPlatformService (IFMXScreenService, IInterface(ScreenService)) then | |
begin | |
Result := ScreenService.GetScreenSize; | |
end; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment