Old 15th November 2012, 09:14   #1
zenpoy
Junior Member
 
Join Date: Feb 2011
Posts: 38
Change the side bar image at run-time

Hi, I would like to download an image and replace the default side bar image with the downloaded image.

What I've tried was to add a resource using reshacker:

code:
CONTROL "", 1999, STATIC, SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0, 109, 222


Than I created a

code:
Page custom FirstPagePre


and a matching function:

code:

Function FirstPagePre
GetDlgItem $0 $HWNDPARENT 1999
ShowWindow $0 ${SW_SHOW}
${NSD_SetImageOLE} $0 "http://localhost/sidebar.jpg" $1
FunctionEnd



the problem is that the default image is hiding the custom image:



I also tried using inetc to download the image (a bmp image) and to use the command SetBrandingImage but I got the same result.

Thanks,

J.
zenpoy is offline   Reply With Quote
Old 15th November 2012, 09:30   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Using MUI2 you can just use ${NSD_SetImage} or ${NSD_SetStretchedImage} on $mui.WelcomePage.Image (the existing image control handle) in the welcome page's show function.

Make sure you call ${NSD_FreeImage} $mui.WelcomePage.Image.Bitmap first to free the existing bitmap.

The code is in Contrib\Modern UI 2\Pages\Welcome.nsh.

Stu
Afrow UK is offline   Reply With Quote
Old 15th November 2012, 11:33   #3
zenpoy
Junior Member
 
Join Date: Feb 2011
Posts: 38
Thanks Stu, as always
zenpoy 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