I created a setup with custom wizard pages and custom background images. The problem is with non-standard DPI systems.
When I run this setup the background images ar
Deanna mentioned that the DPI can be detected like so:
You can detect the DPI size using the
TGraphicsObject.PixelsPerInchproperty 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;
Define the following functions by yourself to cheat Inno Setup:
function ScaleX(Value: Integer): Integer;
begin
Result := Value;
end;
function ScaleY(Value: Integer): Integer;
begin
Result := Value;
end;
Bing GO~
The "most correct" way is to have alternative images for small and larger fonts mode. The "slightly less correct" method is to pad the background so it shows that instead of shrinking. The "very wrong" method is to try and adjust the form layout/size to suit.
You can detect the DPI size using the TGraphicsObject.PixelsPerInch property and load a different image.