Menu

#521 Enhance MUI Image Scaling Calculation

2.0 Series
closed-fixed
nobody
None
1
2014-07-16
2013-09-13
Kevin Gale
No

When creating a NSIS installer and running it on an Asian system there appears to be no way to get the MUI_WELCOMEFINISHPAGE_BITMAP, MUI_UNWELCOMEFINISHPAGE_BITMAP, MUI_UI_HEADERIMAGE and MUI_UNWELCOMEFINISHPAGE_BITMAP images to display correctly due to the different font size / DPI of the dialog.

To demonstrate the problem I have enclosed a zip file with some screen shots.
1. English 01.png / English 02.png
These are the first two installer screens running under Windows 7 and an English operating system.

  1. Japanese 01.png / Japanese 02.png
    These are the first two installer screens running under Windows XP and a Japanese operating system.

  2. Japanese No Stretch 01.png / Japanese No Stretch 02.png
    These are two first two installer screens using the NOSTRETCH feature running under Windows XP and a Japanese operating system.

If you compare the welcome image down the left-hand side you will see that:
a) 'Japanese 01.png' shows all of the image in the vertical direction but stretches it out of proportion in the horizontal direction.

b) 'Japanese No Stretch 01.png' has the correct proportions but the bottom of the image is missing.

From this I see two enhancements:
Enhancement 1 - Keep The Proportions When Stretching
Ideally you want the welcome image to scale so that it fills the space vertically and then uses the same ratio to scale horizontally so that the proportions are kept equal (why you would ever want to scale the image the way it does now is anybody's guess).

Enhancement 2 - When Not Stretching Make Sure Dialog Control Heights Are Not Reduced
The fact that the bottom of the image is clipped when it is not stretched seems to indicate that the height of the dialog control is less than the recommended height. The enhancement here would be to always make sure that controls were at minimum the recommended dimensions.

If you compare the header image at the top-left you will see that:
a) 'Japanese No Stretch 01.png' shows all of the picture in the vertical direction but stretches it out of proportion in the horizontal direction.

b) 'Japanese No Stretch 02.png' has the correct proportions but the bottom of the image extends down past the height of the header area. This causes a visual glitch in the header bar as part of the graphics are missing.

Again, the above enhancements would solve these issues as well.

Kev.

1 Attachments

Discussion

  • Anders

    Anders - 2014-07-16
    • status: open --> closed-fixed
     
  • Anders

    Anders - 2014-07-16

    I have added two new scaling modes and AspectFitHeight should fit your needs. The two old modes worked the way they did because it required no code on our end, it just used the Windows static image control directly without any calculations on our end.

     

Log in to post a comment.