Ich hatte da mal das
hier gefunden und für mich folgendes rausgezogen:
Delphi-Quellcode:
function TPaintingGrid.SetScreenDPIandScale(const Context: TFmxObject = nil):
Boolean;
var
DeviceBehavior: IDeviceBehavior;
DisplayMetrics: TDeviceDisplayMetrics;
{$IFDEF ANDROID}
dm: JDisplayMetrics;
{$ENDIF}
begin
Result := False;
{$IFDEF ANDROID}
dm := GetJDisplayMetrics;
if dm <> nil then
begin
fppi := dm.densityDpi;
fScale := dm.scaledDensity;
Result := True;
exit;
end;
{$ENDIF}
if TBehaviorServices.Current.SupportsBehaviorService(IDeviceBehavior,
DeviceBehavior, Context) then
begin
DisplayMetrics := DeviceBehavior.GetDisplayMetrics(Context);
fScale := DisplayMetrics.ScreenScale;
fppi := DisplayMetrics.PixelsPerInch; // / (fScale * fScale);
fScreenWidth := DisplayMetrics.LogicalScreenSize.Width;
Result := True;
end;
end;
Sherlock