Override the maximum size of WizardSmallImage

狂风中的少年 提交于 2019-12-08 06:05:29

问题


I'm trying to set a custom image for the WizardSmallImage of a installer I'm making, but, I have run onto a problem: the image I'm trying to use exceeds the max size for WizardSmallImage (55x58). Since I'm doing this for a friend, I can't cut/shrink his image.

So, is there any way to override this max size? I have tried to change the properties of WizardForm.WizardSmallBitmapImage manually by writing this code in the [Code] section:

procedure InitializeWizard;
begin
  WizardForm.WizardSmallBitmapImage.Stretch := false;
  WizardForm.WizardSmallBitmapImage.Width := 150
end;

But it didn't work...

If anyone could answer me, I would be really grateful!!


回答1:


When you increase Width of WizardSmallBitmapImage it overlaps right edge of the window. You have to move it to the left too.

If you need to make it too wide (150), you also need to make the labels (PageDescriptionLabel and PageNameLabel) to the left more narrow.

procedure InitializeWizard;
var Diff: Integer;
begin
    ....
    Diff := ScaleX(150) - WizardForm.WizardSmallBitmapImage.Width;
    WizardForm.WizardSmallBitmapImage.Width := 
        WizardForm.WizardSmallBitmapImage.Width + Diff
    WizardForm.WizardSmallBitmapImage.Left :=
        WizardForm.WizardSmallBitmapImage.Left - Diff;
    WizardForm.PageDescriptionLabel.Width := 
        WizardForm.PageDescriptionLabel.Width - Diff;
    WizardForm.PageNameLabel.Width := 
        WizardForm.PageNameLabel.Width - Diff;
    ...
end;


来源:https://stackoverflow.com/questions/28434906/override-the-maximum-size-of-wizardsmallimage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!