首页 > 解决方案 > 在 Inno Setup 中,如何在向导窗口的左下方添加图像横幅?

问题描述

左侧图片横幅

如何在 Inno Setup 中将图像添加到左下角的设置向导?

标签: inno-setup

解决方案


正如@TLama 评论的那样:创建一个TBitmapImage,将其父级设置为WizardForm,将其放置在您想要的位置并从文件中加载图片。

[Files]
Source: "logo.bmp"; Flags: dontcopy

[Code]

<event('InitializeWizard')>
procedure InitializeWizardAddLogo();
var
  Image: TBitmapImage;
begin
  Image := TBitmapImage.Create(WizardForm);
  with Image do
  begin
    Parent := WizardForm;
    ExtractTemporaryFile('logo.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\logo.bmp');
    AutoSize := True;
    AutoSize := False;
    Width := ScaleX(Width);
    Height := ScaleY(Height);
    Stretch := True;
    Left := ScaleX(10);
    Top :=
      (WizardForm.ClientHeight + WizardForm.Bevel.Top + WizardForm.Bevel.Height - Height)
      div 2;
  end;
end;

(代码 [with eventattribute] 用于 Inno Setup 6)

虽然棘手的部分是正确处理屏幕缩放。因此,AutoSize伎俩和Scale*电话。

您甚至可能需要针对不同比例因子使用不同版本的徽标。
请参阅Inno Setup WizardImageFile 在 Windows 7 上的字体缩放看起来很糟糕


在此处输入图像描述


推荐阅读