These are bitmap images; they naturally do not scale well. You are just lucky that your own images do not look so bad when scaling.
You must prepare your own set of images for the general scaling factors and dynamically choose the right one. Inno Setup has no built-in support.
The common scaling factors currently in use are 100%, 125%, 150% and 200%. Thus, you must have four sizes for the images.
You can use WizardImageFile and WizardSmallImageFile to assign images at 100% size and use the Pascal script to override this setting when using large scaling.
Let's say I have these image files:
WizardImage 100.bmp WizardImage 125.bmp WizardImage 150.bmp WizardImage 200.bmp WizardSmallImage 100.bmp WizardSmallImage 125.bmp WizardSmallImage 150.bmp WizardSmallImage 200.bmp
So you use them to display the correct scale size on the user machine:
[Setup] ; Use 100% images by default WizardImageFile=WizardImage 100.bmp WizardSmallImageFile=WizardSmallImage 100.bmp [Files] ; Embed all other sizes to the installer Source: "WizardImage *.bmp"; Excludes: "* 100.bmp"; Flags: dontcopy Source: "WizardSmallImage *.bmp"; Excludes: "* 100.bmp"; Flags: dontcopy [Code] function GetScalingFactor: Integer; begin if WizardForm.Font.PixelsPerInch >= 192 then Result := 200 else if WizardForm.Font.PixelsPerInch >= 144 then Result := 150 else if WizardForm.Font.PixelsPerInch >= 120 then Result := 125 else Result := 100; end; procedure LoadEmbededScaledBitmap(Image: TBitmapImage; NameBase: string); var Name: String; FileName: String; begin Name := Format('%s %d.bmp', [NameBase, GetScalingFactor]); ExtractTemporaryFile(Name); FileName := ExpandConstant('{tmp}\' + Name); Image.Bitmap.LoadFromFile(FileName); DeleteFile(FileName); end; procedure InitializeWizard; begin { If using larger scaling, load the correct size of images } if GetScalingFactor > 100 then begin LoadEmbededScaledBitmap(WizardForm.WizardBitmapImage, 'WizardImage'); LoadEmbededScaledBitmap(WizardForm.WizardBitmapImage2, 'WizardImage'); LoadEmbededScaledBitmap(WizardForm.WizardSmallBitmapImage, 'WizardSmallImage'); end; end;
You might want to do the same for SelectDirBitmapImage , SelectGroupBitmapImage and PreparingErrorBitmapImage .
See also:
- How to detect and "fix" DPI settings using Inno Setup?
- Inno Setup Image Placement / Management on User Page
Martin Prikryl Jun 23 '15 at 12:44 2015-06-23 12:44
source share