Tom*_*Tom 3 inno-setup pascalscript dpi-aware
Inno Setup WizardImageFile(和WizardSmallImageFile)的位图看起来很糟糕,因为当 Windows 7 启用了大系统字体时,向导会比平时大,但图像的缩放比例非常错误。
有解决办法吗?
如果我在这样的地方添加自己的图片,就没有类似的问题:
BitmapImage1.AutoSize := True;
BitmapImage1.Align := alClient;
BitmapImage1.Left := 0;
BitmapImage1.Top := 0;
BitmapImage1.stretch := True;
BitmapImage1.Parent := Splash;
Run Code Online (Sandbox Code Playgroud)
这些是位图图像,它们自然缩放不好。您很幸运,您自己的图像在缩放时看起来并没有那么糟糕。
您必须为常见的缩放因子准备自己的一组图像。
现在常用的缩放因子有 100%、125%、150% 和 200%。所以你应该有四种尺寸的图像,比如:
WizardImage 100.bmp
WizardImage 125.bmp
WizardImage 150.bmp
WizardImage 200.bmp
WizardSmallImage 100.bmp
WizardSmallImage 125.bmp
WizardSmallImage 150.bmp
WizardSmallImage 200.bmp
Run Code Online (Sandbox Code Playgroud)
自 5.6 以来,Inno Setup 可以自动选择图像的最佳版本。只需在WizardImageFile和 中列出您的图像版本即可WizardSmallImageFile。您可以使用通配符:
[Setup]
WizardImageFile=WizardImage *.bmp
WizardImageFile=WizardSmallImage *.bmp
Run Code Online (Sandbox Code Playgroud)
在旧版本的 Inno Setup(或者如果您需要自定义选择算法或在向导中有其他自定义图像时),您必须以编程方式选择图像。
以下示例或多或少与 Inno Setup 5.6 相同:
[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
Run Code Online (Sandbox Code Playgroud)
WizardImage 100.bmp
WizardImage 125.bmp
WizardImage 150.bmp
WizardImage 200.bmp
WizardSmallImage 100.bmp
WizardSmallImage 125.bmp
WizardSmallImage 150.bmp
WizardSmallImage 200.bmp
Run Code Online (Sandbox Code Playgroud)
您可能希望对SelectDirBitmapImage、SelectGroupBitmapImage和执行相同的操作PreparingErrorBitmapImage。
也可以看看:
| 归档时间: |
|
| 查看次数: |
2420 次 |
| 最近记录: |