I started to develop a game under Delphi XE5 for iOS. I have problem with the Resolution feature of the Firemonkey.
When I open the screen and I check resolution on the iPhone I get 320x480. But the native resolution of the iPhone 4 and 5 is doubled. I found at official Delphi pages that FireMonkey is recalculating the screen by "Resolution" which is for Retina display 2.
I think this is cool feature for regular apps, but when you start to do game and you want to manipulate with images by code it brings weird situations.
My question is - is there way to find the actual Resolution value or at least what is the actual device type (iPhone,iPad?)
thanks
ok, we found the answers.
There is unit FMX.Platform that procides quite vital data.
var
ScreenSvc: IFMXScreenService;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, IInterface(ScreenSvc)) then
begin
<your code>
end;
end;
and the result values are:
ScreenSvc.GetScreenSize.X
ScreenSvc.GetScreenSize.Y
ScreenSvc.GetScreenScale
来源:https://stackoverflow.com/questions/20124191/how-to-find-resolution-under-delphi-xe5