加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Inno设置:TBitmapImage没有显示

发布时间:2020-12-15 09:28:15 所属栏目:大数据 来源:网络整理
导读:我想使用TBitmap Image类为我的Inno Script添加自定义设计按钮. 我的Inno安装脚本编译得很好,但位图没有在表单中显示.我调查了任何可能性,但似乎无法找到我所犯的错误.这就是TBitmapImage部分看起来像atm: procedure CreateMuteButton(ParentForm: TSetupFo
我想使用TBitmap Image类为我的Inno Script添加自定义设计按钮.

我的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;

解决方法

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;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读