Archive: MUI_HEADERIMAGE_NOSTRETCH not working after MUI_HEADERIMAGE_INIT ?


MUI_HEADERIMAGE_NOSTRETCH not working after MUI_HEADERIMAGE_INIT ?
Hello,
i want to change the header image for a specific code.

The problem is that when i change the image , afterwards in the next page the header image is stretched. I think it is because i call

!insertmacro MUI_HEADERIMAGE_INIT "" in my code, but i am not sure.

here is my code to change the image :

In the beginning of the script :


!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\win.bmp"
!define MUI_HEADERIMAGE_NOSTRETCH

Afterwards :


!macro fixheaderimgafterupdate
;Ugly way to trigger a repaint
GetDlgItem $0 $hwndparent 1046
ShowWindow $0 0
ShowWindow $0 1
!macroend

Function setdirimg
File "/oname=$PLUGINSDIR\custom.bmp" "custom.bmp"
SetBrandingImage /IMGID=1046 "$PLUGINSDIR\custom.bmp"
!insertmacro fixheaderimgafterupdate
FunctionEnd

Function resetimg
#SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp" ;This also works, but does not deal with stretching etc
!insertmacro MUI_HEADERIMAGE_INIT ""

!insertmacro fixheaderimgafterupdate
FunctionEnd

Use SetBrandingImage with /RESIZETOFIT.

Stu


I do not want to resize the image that's the problem.

Originally posted by Afrow UK
Use SetBrandingImage with /RESIZETOFIT.

Stu

Your define is wrong. It should be MUI_HEADERIMAGE_BITMAP_NOSTRETCH.

Stu