How to determine and "fix" DPI settings using Inno Setup?

I created a customization with customizable wizard pages and custom background images. The problem is with non-standard DPI systems.

When I run this setting, background images do not display properly. How to determine DPI size and use custom settings for wizard pages?

0
inno-setup
Jul 05 2018-11-11T00:
source share
3 answers

The “most correct” way is to have alternative images for small and large font mode. A “slightly less correct” method is to overlay the background so that it shows that instead of reducing. A “very wrong” method is to try to adjust the layout / size of the form to fit.

You can determine the DPI size using the TGraphicsObject.PixelsPerInch property and load another image.

+3
Jul 07 '11 at 11:13
source share

Deanna mentioned that DPI can be detected as follows:

You can determine the DPI size using the TGraphicsObject.PixelsPerInch property and load another image.

However, the InnoSetup documentation assumes that TGraphicsObject does not have a PixelsPerInch attribute, it is an attribute of TFont objects.

In this way, DPI can be detected, and user settings will be implemented using code like 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; 
+3
Nov 20 '14 at 12:47
source share

Define the following functions yourself to trick Inno Setup:

 function ScaleX(Value: Integer): Integer; begin Result := Value; end; function ScaleY(Value: Integer): Integer; begin Result := Value; end; 

Bing GO ~

-3
May 15 '14 at 6:43
source share



All Articles