Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup: TBitmapImage isn't showing up

I want to add custom designed buttons to my Inno Script with the TBitmapImage class.

My Inno Setup script is compiling just fine but the bitmap isn't showing in the form. I looked into any possibilities but can't seem to find the error I made. That's how the TBitmapImage part looks like 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;
like image 205
timonsku Avatar asked May 27 '12 20:05

timonsku


1 Answers

The WizardForm client area itself is only visible below the bottom bevelled line. Above that is WizardForm.InnerPage, and the individual/current Wizard pages in the middle contained in a private InnerNotebook.

This puts the image to the left of the pages:

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; 

Whereas this puts it in the bottom section:

MuteImage := TBitmapImage.Create(WizardForm);
MuteImage.Parent := WizardForm;
MuteImage.Left := 0;
{ Below the inner page }
MuteImage.Top := WizardForm.InnerPage.Height; 
like image 89
Deanna Avatar answered Oct 13 '22 23:10

Deanna