Full Page Image in Inno Setup

After that: Inno Setup Place image / control on user page .

This does what I need:

CustomPage := CreateCustomPage(wpLicense, 'Heading', 'Sub heading.'); ExtractTemporaryFile('image.bmp'); BtnImage := TBitmapImage.Create(WizardForm); with BtnImage do begin Parent := CustomPage.Surface; Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\image.bmp'); AutoSize := True; AutoSize := False; Height := ScaleX(Height); Width := ScaleY(Width); Stretch := True; Left := ScaleX(90); Top := WizardForm.SelectTasksPage.Top + WizardForm.SelectTasksPage.Height - Height - ScaleY(8); Cursor := crHand; OnClick := @ImageOnClick; end; 

However, I would like the background image to be the full size of the space below the header and above the footer without side margins. I tried to distinguish between stretch / margin / height / width, but the results are messy. What is the best way to achieve this that looks good regardless of DPI?

+2
inno-setup pascalscript
Jun 10 '17 at 9:58 on
source share
1 answer

You can get the size of the (custom) surface of the page using TWizardPage.SurfaceHeight and TWizardPage.SurfaceWidth .

 BtnImage.Height := CustomPage.SurfaceHeight; BtnImage.Width := CustomPage.SurfaceWidth; 

Although you will see that the (custom) page does not cover the entire area between the "header" ( MainPanel ) and the "footer" (the bottom with buttons).

enter image description here




If you want to display an image over the entire area between the "header" and the "footer", you cannot place it on a (user) page. You should put it on InnerPage (which is the parent control of all the pages with the title).

 BtnImage.Parent := WizardForm.InnerPage; BtnImage.Left := 0; BtnImage.Top := WizardForm.Bevel1.Top + 1; BtnImage.Width := WizardForm.InnerPage.ClientWidth; BtnImage.Height := WizardForm.InnerPage.ClientHeight - BtnImage.Top; 

But in this way the image will not be automatically displayed / hidden as the user page shows / hides. You must encode it. Use the CurPageChanged event function .

 procedure CurPageChanged(CurPageID: Integer); begin WizardForm.InnerNoteBook.Visible := (CurPageID <> CustomPage.ID); BtnImage.Visible := (CurPageID = CustomPage.ID); end; 

enter image description here




Related questions:

  • Display image even above the title:
    How to hide the main panel and show the image on the whole page?
  • Displaying the image as the background of the entire window: Inno Setup - the image as the background of the installer .
+1
Jun 10 '17 at 12:50
source share



All Articles