欢迎标签在Inno设置上透明 [英] Welcome Label Transparent on Inno Setup

查看:173
本文介绍了欢迎标签在Inno设置上透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Inno Setup上不显示WelcomeLabel,而只在图像上保留文本.

How do I WelcomeLabel on Inno Setup does not appear and leave only the text over the image.

这就是我想要的.

推荐答案

类似的方法可能会解决问题.由于欢迎标签不支持透明性,因此您需要通过使用不同的类(具有透明性支持)创建自己的类,继承父类,字体,文本和大小并隐藏原始类来解决此问题.这是脚本的执行方法:

Something like this might do the trick. Since the welcome labels don't support transparency, you need to workaround this by creating your own with a different class (that has a transparency support), inherit the parent, font, text and size and hide the original ones. Here is the script how to do this:

[Code]
procedure InheritBoundsRect(ASource, ATarget: TControl);
begin
  ATarget.Left := ASource.Left;
  ATarget.Top := ASource.Top;
  ATarget.Width := ASource.Width;
  ATarget.Height := ASource.Height;
end;

procedure InitializeWizard;
var
  TopWelcomeLabel: TLabel;
  BottomWelcomeLabel: TLabel;
begin
  WizardForm.WizardBitmapImage.Align := alClient;
  WizardForm.WizardBitmapImage.Bitmap.LoadFromFile('D:\Image.bmp');

  TopWelcomeLabel := TLabel.Create(WizardForm);
  TopWelcomeLabel.Parent := WizardForm.WelcomeLabel1.Parent;
  TopWelcomeLabel.Font := WizardForm.WelcomeLabel1.Font;
  TopWelcomeLabel.Caption := WizardForm.WelcomeLabel1.Caption;
  TopWelcomeLabel.WordWrap := WizardForm.WelcomeLabel1.WordWrap;
  InheritBoundsRect(WizardForm.WelcomeLabel1, TopWelcomeLabel);
  WizardForm.WelcomeLabel1.Visible := False;

  BottomWelcomeLabel := TLabel.Create(WizardForm);
  BottomWelcomeLabel.Parent := WizardForm.WelcomeLabel2.Parent;
  BottomWelcomeLabel.Font := WizardForm.WelcomeLabel2.Font;
  BottomWelcomeLabel.Caption := WizardForm.WelcomeLabel2.Caption;
  BottomWelcomeLabel.WordWrap := WizardForm.WelcomeLabel2.WordWrap;
  InheritBoundsRect(WizardForm.WelcomeLabel2, BottomWelcomeLabel);
  WizardForm.WelcomeLabel2.Visible := False;
end;

结果:

这篇关于欢迎标签在Inno设置上透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆