将Inno Setup MainPanel调整为横幅图像大小 [英] Adjust Inno Setup MainPanel to banner image size

查看:87
本文介绍了将Inno Setup MainPanel调整为横幅图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能调整我正在为MainPanel使用的图像的大小.这正在引起问题,因为它涵盖了我创建的输入查询页面.如何确定带有增长"的输入查询页面尺寸由MainPanel图片设置的尺寸?

The image I am not allowed to resize the image I am using for the MainPanel. This is causing issues, as it is covering an input query page I have created. How do I make sure the input query page with "grow" with the size dimensions set by the MainPanel image?

procedure InitializeWizard;
begin
  { Extract the banner so we can use it with the input page. }
  BannerImage := TBitmapImage.Create(WizardForm);
  BannerImage.Bitmap.LoadFromFile('C:\temp\tempbanner.bmp');
  { Create the Bitmap Banner img to show on the Main Panel. }
  BannerImage.Parent := WizardForm.MainPanel;
  WizardForm.MainPanel.Width := SPLASH_SCREEN_WIDTH;
  WizardForm.MainPanel.Height := BANNER_HEIGHT; 
  BannerImage.Width := WizardForm.MainPanel.Width;
  BannerImage.Height := WizardForm.MainPanel.Height;
  { BannerImage.Anchors := [akLeft, akTop, akRight, akBottom]; }
  BannerImage.Stretch := False;
  BannerImage.AutoSize := False;
  
  WizardForm.WizardSmallBitmapImage.Visible := False;
  WizardForm.PageDescriptionLabel.Visible := False;
  WizardForm.PageNameLabel.Visible := False;
  
  { Create the input page }
  ReportingServerPage := CreateInputQueryPage(wpWelcome,
  'Title', 'What is your XXX?',
  'Please enter your Server URL, then click Next.'+#13#10+#13#10+'If you proceed without entering a URL, you can update it in the %AppData%\xxxxxxxx\xxxx\xxxxx\xxxx_launcher.properties file at a later stage.');
  ReportingServerPageId := ReportingServerPage.ID;
  {  Add items (False means it's not a password edit) }
  ReportingServerPage.Add('&Reporting Server URL:', False);

end;

推荐答案

您必须增加窗口高度并向下移动窗口内容(Bevel1InnerNotebook).

You have to increase window height and move the window contents (Bevel1 and InnerNotebook) down.

请注意,底部对齐的控件(底部按钮)会随着窗口高度的增加而自动移动(假设您使用的是最新版本的Inno Setup).

Note that the bottom aligned controls (the bottom buttons) move automatically with the window height increase (assuming you use the latest version of Inno Setup).

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

[Code]

var
  ReportingServerPage: TInputQueryWizardPage;

procedure InitializeWizard;
var
  BannerImage: TBitmapImage;
  Delta: Integer;
begin
  BannerImage := TBitmapImage.Create(WizardForm);
  ExtractTemporaryFile('banner.bmp');
  BannerImage.AutoSize := True;
  BannerImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\banner.bmp'));
  BannerImage.Parent := WizardForm.InnerPage;
  BannerImage.Left := 0;
  BannerImage.Top := 0;

  Delta := BannerImage.Height - WizardForm.Bevel1.Top;
  WizardForm.Height := WizardForm.Height + Delta;
  WizardForm.Bevel1.Top := WizardForm.Bevel1.Top + Delta;
  WizardForm.InnerNotebook.Top := WizardForm.InnerNotebook.Top + Delta;
  WizardForm.InnerNotebook.Height := WizardForm.InnerNotebook.Height - Delta;

  WizardForm.MainPanel.Visible := False;
  
  { Create the input page }
  ReportingServerPage := CreateInputQueryPage(wpWelcome,
    'Title', 'What is your XXX?',
    'Please enter your Server URL, then click Next.'+#13#10+#13#10+
    'If you proceed without entering a URL, you can update it in the ' + 
    '%AppData%\xxxxxxxx\xxxx\xxxxx\xxxx_launcher.properties file at a later stage.');
  {  Add items (False means it's not a password edit) }
  ReportingServerPage.Add('&Reporting Server URL:', False);
end;

请注意,该代码不适合图像/窗口宽度.假定图像宽度适合窗口宽度.

Note that the code does not cater for image/window width. It assumes the image width fits the window width.

这篇关于将Inno Setup MainPanel调整为横幅图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆