Inno Setup会自动拉伸
WelcomePage
和
FinishedPage
将页面调整到全宽。似乎它不期望在那里有自定义控件。
你必须设法解决它。
在您的情况下(因为图像右侧没有任何内容),一个简单的解决方案是将背景颜色设置为页面颜色(白色/窗口颜色)。
AuthorWebsiteBitmap.BackColor := WizardForm.WelcomePage.Color;
虽然它不适合手工烹饪。
另一种选择是将图像放置在容器控件上(例如。
TPanel
). Inno Setup只会调整容器控件的大小,留下图像实例。
var
AuthorWebsitePanel: TPanel;
AuthorWebsiteBitmap : TBitmapImage;
begin
AuthorWebsitePanel := TPanel.Create(WizardForm);
AuthorWebsitePanel.Parent := WizardForm.WelcomePage;
AuthorWebsitePanel.Left := WizardForm.WelcomeLabel2.Left;
AuthorWebsitePanel.Color := WizardForm.WelcomePage.Color;
// That's what Inno Setup would do later anyway
AuthorWebsitePanel.Width := WizardForm.WelcomeLabel2.Width;
AuthorWebsitePanel.BevelOuter := bvNone;
AuthorWebsiteBitmap := TBitmapImage.Create(WizardForm);
AuthorWebsiteBitmap.Parent := AuthorWebsitePanel;
AuthorWebsiteBitmap.Left := 0;
AuthorWebsiteBitmap.Top := 0;
ExtractTemporaryFiles('{tmp}\WizardBitmaps\AuthorWebsiteWhite.bmp');
AuthorWebsiteBitmap.Bitmap.LoadFromFile(
ExpandConstant('{tmp}\WizardBitmaps\AuthorWebsiteWhite.bmp'));
AuthorWebsiteBitmap.AutoSize := True;
AuthorWebsiteBitmap.Cursor := crHand;
AuthorWebsiteBitmap.OnClick := @AuthorWebsiteControlClick;
AuthorWebsiteBitmap.Visible := (AuthorWebsiteUrl <> '');
AuthorWebsitePanel.Height := AuthorWebsiteBitmap.Height;
AuthorWebsitePanel.Top :=
(WizardForm.WelcomeLabel2.Top + WizardForm.WelcomeLabel2.Height) -
AuthorWebsitePanel.Height - ScaleY(16);
AuthorWebsitePanel.Anchors := [akLeft, akBottom];
WizardForm.WelcomeLabel2.Height :=
WizardForm.WelcomeLabel2.Height - AuthorWebsitePanel.Height;
// ...
end;