Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th September 2012, 11:42   #1
alex001
Junior Member
 
Join Date: Aug 2011
Posts: 10
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 :
code:

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


Afterwards :

code:

!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

alex001 is offline   Reply With Quote
Old 13th September 2012, 11:50   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use SetBrandingImage with /RESIZETOFIT.

Stu
Afrow UK is offline   Reply With Quote
Old 20th September 2012, 10:41   #3
alex001
Junior Member
 
Join Date: Aug 2011
Posts: 10
I do not want to resize the image that's the problem.

Quote:
Originally Posted by Afrow UK View Post
Use SetBrandingImage with /RESIZETOFIT.

Stu
alex001 is offline   Reply With Quote
Old 20th September 2012, 11:02   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Your define is wrong. It should be MUI_HEADERIMAGE_BITMAP_NOSTRETCH.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump