Archive: How to add an image to a dialog


How to add an image to a dialog
This seems like a simple problem but I have been banging my head against my monitor for ages on this!

All I want to do is add an image to a dialog as per the attached example - I have a top banner and a left image - All I want is to display an image in the middle of the dialog.

PLEASE, if anybody has done this before, HELP!


OMG - Somehow after posting this I actually figured it out.

Now I know that I searched and searched for this answer so hopefully this will help others - Here is my solution:

The trick is:

${NSD_CreateBitmap} 100u 100u 109u 193u ""
Pop $Img_Left
${NSD_SetImage} $Img_Left $1 $Img_Handle_Left

$1 is whereever the image is stored.

Here it is within context (Sorry if I am wasting space here and that everybody else already knows this, but I an so excited about figuring this out I had to share):

nsDialogs::Create 1044
Pop $SCRpage
SetCtlColors $SCRpage 0 0xffffff
Call LoadImages
nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_BITMAP} 0 0 0 109u 193u ""
Pop $imageCtrlLeft
nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_BITMAP} 0 164 0 420u 42u ""
Pop $imageCtrlUp
SendMessage $imageCtrlLeft ${STM_SETIMAGE} ${IMAGE_BITMAP} $imageLeft
SendMessage $imageCtrlUp ${STM_SETIMAGE} ${IMAGE_BITMAP} $imageUp
${NSD_CreateLabel} 170 70 400 80 "The associated Screen Saver, $scrVALUE.scr is also available to download. Would you like to download the Screen Saver at the end of this installation."
Pop $downloadPageLabel
SetCtlColors $downloadPageLabel 0 0xffffff

${NSD_CreateBitmap} 100u 100u 109u 193u ""
Pop $Img_Left
${NSD_SetImage} $Img_Left $1 $Img_Handle_Left

${NSD_SetText} $mui.Button.Next "&Yes"
${NSD_SetText} $mui.Button.Cancel "&No"
Call HideControls
nsDialogs::Show
Call ShowControls
System::Call gdi32::DeleteObject(i$imageLeft)
System::Call gdi32::DeleteObject(i$imageUpper)


${NSD_CreateBitmap}
http://nsis.sourceforge.net/Docs/nsD...ml#mref-create


Yes, MSG is right: inside regular window there is a smaller window [Inner Dialog] which cannot be modified by Reshacker.
use nsDialogs functions for this.