7

I have created a custom welcome page with an image on it but the main panel on the top remains to be displayed. For what I want to achieve see image below:

enter image description here

Here is the code:

[Code]
procedure InitializeWizard;
var
  BitmapFileName: string;
  BitmapImage: TBitmapImage;
  WelcomePage: TWizardPage;
begin
  WelcomePage := CreateCustomPage(wpWelcome, '', '');    

  BitmapFileName := ExpandConstant('{tmp}\DataNova_Logo.bmp');
  ExtractTemporaryFile(ExtractFileName(BitmapFileName));

  BitmapImage := TBitmapImage.Create(WelcomePage);
  BitmapImage.AutoSize := True;
  BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
  BitmapImage.Cursor := crHand;
  BitmapImage.Left := 10;
  BitmapImage.Top := 10;
  BitmapImage.Parent := WelcomePage.Surface;
end;

How to show the image over the whole page with the main panel hidden ?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Sunil Sharma
  • 782
  • 1
  • 10
  • 22
  • If you do not want to use your own solution I can recommend you this project for creating cool skinned Inno installers:http://graphical-installer.com. Picture: http://graphical-installer.com/joomla/images/stories/gallery/projects/gallery-18.jpg – Slappy Jun 25 '12 at 05:44

1 Answers1

8

You need to hide the Bevel1, MainPanel and the InnerNotebook components when you switch to your welcome page and show them again when you leave it. As the opposite, the image you need to show only when you're showing your welcome page since it covers the whole page area. So the following code will do the trick:

[Code]
var
  WelcomePageID: Integer;
  BitmapImage: TBitmapImage;

procedure InitializeWizard;
var
  WelcomePage: TWizardPage;  
begin
  WelcomePage := CreateCustomPage(wpWelcome, '', '');
  WelcomePageID := WelcomePage.ID;
  BitmapImage := TBitmapImage.Create(WizardForm);
  BitmapImage.Bitmap.LoadFromFile('C:\Image.bmp');
  BitmapImage.Top := 0;
  BitmapImage.Left := 0;
  BitmapImage.AutoSize := True;
  BitmapImage.Cursor := crHand;
  BitmapImage.Visible := False;
  BitmapImage.Parent := WizardForm.InnerPage;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  BitmapImage.Visible := CurPageID = WelcomePageID;
  WizardForm.Bevel1.Visible := CurPageID <> WelcomePageID;
  WizardForm.MainPanel.Visible := CurPageID <> WelcomePageID;
  WizardForm.InnerNotebook.Visible := CurPageID <> WelcomePageID;
end;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
TLama
  • 75,147
  • 17
  • 214
  • 392
  • For a similar questions, see [Inno Setup - Image as installer background](https://stackoverflow.com/q/41049054/850848) (background image over whole window) or [Image covering whole page in Inno Setup](https://stackoverflow.com/q/44471989/850848) (background image over whole page, between "header" and "footer"). – Martin Prikryl Jun 12 '17 at 18:21