Inno设置:TBitmapImage没有显示出来

时间:2012-05-27 20:49:41

标签: bitmap inno-setup imagebutton

我想使用TBitmapImage类为我的Inno脚本添加自定义设计按钮。

我的Inno安装脚本编译得很好,但位图没有显示在表单中。我调查了任何可能性,但似乎无法找到我所犯的错误。这就是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;

1 个答案:

答案 0 :(得分:5)

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;