Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Welcome Label Transparent on Inno Setup

Tags:

inno-setup

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

This is that i want.

enter image description here

like image 757
Andrezork Avatar asked Aug 15 '12 02:08

Andrezork


1 Answers

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;

And the result:

enter image description here

like image 122
TLama Avatar answered Oct 28 '22 05:10

TLama