问题
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;
回答1:
You have to increase window height and move the window contents (Bevel1
and InnerNotebook
) down.
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.
来源:https://stackoverflow.com/questions/62907577/adjust-inno-setup-mainpanel-to-banner-image-size