Deanna mentioned that the DPI can be detected like so:
You can detect the DPI size using the TGraphicsObject.PixelsPerInch
property and load a different image.
However, the InnoSetup documentation suggests that TGraphicsObject
has no PixelsPerInch
attribute, it is instead an attribute of TFont
objects.
The DPI can therefore be detected and custom settings be implemented using code similar to this:
procedure CheckDPI;
var
CurrentDPI, StandardDPI, MediumDPI, LargeDPI: Integer;
begin
{ Get the current DPI }
CurrentDPI := WizardForm.Font.PixelsPerInch;
{ Store defaults determined from Windows DPI settings }
StandardDPI := 96; { 100% }
MediumDPI := 120; { 125% }
LargeDPI := 144; { 150% }
if (CurrentDPI >= StandardDPI) and (CurrentDPI < MediumDPI) then
begin
{ Execute some custom code for small to medium DPI }
end
else if (CurrentDPI >= MediumDPI) and (CurrentDPI < LargeDPI) then
begin
{ Execute some custom code for medium to large DPI }
end
else if (CurrentDPI >= LargeDPI) then
begin
{ Execute some custom code for large DPI or above }
end;
end;