Inno Setup WizardImageFile looks bad with font scaling on Windows 7

The bitmap for the Inno Setup WizardImageFile (and WizardSmallImageFile ) looks awful because when Windows 7 supports large system fonts, the wizard is bigger than usual, but the images do not scale very badly.

Is there a fix?

There is no such problem if I add my own picture somewhere like this:

 BitmapImage1.AutoSize := True; BitmapImage1.Align := alClient; BitmapImage1.Left := 0; BitmapImage1.Top := 0; BitmapImage1.stretch := True; BitmapImage1.Parent := Splash; 
+2
inno-setup
Oct 24 '14 at 7:49
source share
1 answer

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
+2
Jun 23 '15 at 12:44
source share



All Articles