5

我想用TBitmapImage类将自定义设计的按钮添加到我的 Inno Script 中。

我的 Inno Setup 脚本编译得很好,但位图没有显示在表单中。我调查了任何可能性,但似乎找不到我犯的错误。这就是TBitmapImage零件看起来像 atm 的样子:

procedure CreateMuteButton(ParentForm: TSetupForm);
var
  MuteImage: TBitmapImage;
  BitmapFileName: String;
begin
  BitmapFileName := ExpandConstant('{tmp}\muteBtn.bmp');
  ExtractTemporaryFile(ExtractFileName(BitmapFileName));
  MuteImage := TBitmapImage.Create(ParentForm);
  MuteImage.Bitmap.LoadFromFile(BitmapFileName);
  MuteImage.Cursor := crHand;
  MuteImage.OnClick := @MuteButtonOnClick;
  MuteImage.Parent := ParentForm;
  MuteImage.Left := 45;
  MuteImage.Top := 80
  MuteImage.Width := 38;
  MuteImage.Height := 50;
end;

procedure InitializeWizard();
var
  val: Integer;
begin
  CreateMuteButton(WizardForm);
  (...)
end;
4

1 回答 1

6

客户区本身仅在WizardForm底部斜线下方可见。上面是WizardForm.InnerPage,并且中间的个人/当前向导页面包含在私有InnerNotebook.

这会将图像放在页面的左侧:

MuteImage := TBitmapImage.Create(WizardForm.InnerPage);
MuteImage.Parent := WizardForm.InnerPage;
MuteImage.Left := 0;
{ Uses the top of the wizard pages to line up }
MuteImage.Top := WizardForm.SelectDirPage.Parent.Top; 

而这将其放在底部:

MuteImage := TBitmapImage.Create(WizardForm);
MuteImage.Parent := WizardForm;
MuteImage.Left := 0;
{ Below the inner page }
MuteImage.Top := WizardForm.InnerPage.Height; 
于 2012-05-28T10:32:38.057 回答