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

Reply
Thread Tools Search this Thread Display Modes
Old 17th December 2012, 07:12   #1
joeseph
Junior Member
 
Join Date: Dec 2012
Posts: 2
Lightbulb NSIS customer page : Display a "image" using "FileSelected" path

Hi Experts,

Please i want to creat an NSIS customer page, this page will contain "Image" and "Fileselected".

When the user click on the button "Fileselected", he will be able to brows an image, and whene he select it, it (the image) will be display on the "image" field.

The image will be fit to the correct dimenssion (See atached file)


For that i creat a "builer.ini" file:

PHP Code:
[Settings]
NumFields=3

[Field 1]
Type=GroupBox
Left
=0
Right
=-1
Top
=0
Bottom
=-1
Text
=" Browse the image file "
TxtColor=0xFFFFFF

[Field 2]
Type=FileRequest
Left
=11
Right
=-11
Top
=25
Bottom
=38
Filter
=All files|*.*
Flags=FILE_MUST_EXIST|FILE_EXPLORER

[Field 3]
Type=Bitmap
Left
=50
Right
=250
Top
=70
Bottom
=190 

in my NSIS code "NSI" i do this program :
code:
Page Custom Verify



where Verify is :
code:

Function Verify
!insertmacro XPUI_INSTALLOPTIONS_EXTRACT "builder.ini";

!insertmacro XPUI_INSTALLOPTIONS_READ $justpath "builder.ini" "Field 2" "State"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "builder.ini" "Field 3" "Type" "Bitmap"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "builder.ini" "Field 3" "Text" $EXEDIR\Wallpaper\ImageTest.bmp
!insertmacro XPUI_INSTALLOPTIONS_WRITE "builder.ini" "Field 3" "Flags" "RESIZETOFIT"

!insertmacro XPUI_INSTALLOPTIONS_DISPLAY "builder.ini";

FunctionEnd



this code show the image, but when i select an other image i cant display it.

Please, can i find some helps

Thanks
Attached Thumbnails
Click image for larger version

Name:	NSISPagewithImage.jpg
Views:	276
Size:	41.2 KB
ID:	50118  

Last edited by joeseph; 17th December 2012 at 07:17. Reason: addin attached file
joeseph is offline   Reply With Quote
Old 17th December 2012, 08:32   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You need a callback function that is called each time a new image is entered in the fileselect. This function will then send an update message to the image control. I have no idea how to do this with InstallOptions. But I do know that nsDialogs has built-in callback functions that you can use for just this purpose:
http://nsis.sourceforge.net/Docs/nsD...l#ref-onchange

And in any case, nsDialogs has superceded InstallOptions a long time ago. I recommend you look at the tutorial in the nsDialogs readme: http://nsis.sourceforge.net/Docs/nsD...adme.html#step
MSG is offline   Reply With Quote
Old 17th December 2012, 10:16   #3
joeseph
Junior Member
 
Join Date: Dec 2012
Posts: 2
I find the solution her eBanner Plugin:

http://nsis.sourceforge.net/EBanner_plug-in
joeseph is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
custom, fileselected, image, nsis, page

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