| 1 |
BgImage.DLL - NSIS extension DLL |
| 2 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 3 |
|
| 4 |
Displays an image or a gradient with user defined texts and/or images behind the NSIS window. |
| 5 |
Can also play WAVs. |
| 6 |
|
| 7 |
See Example.nsi for a usage example. |
| 8 |
|
| 9 |
Usage |
| 10 |
~~~~~ |
| 11 |
|
| 12 |
1) Call SetBg to set the background |
| 13 |
2) Call AddText, or AddImage to add texts and images |
| 14 |
3) Call Redraw to update the background window |
| 15 |
4) Optional - repeat steps 2-3 to add more images |
| 16 |
-or- |
| 17 |
call Clear and repeat steps 1-3 for a completely new background. |
| 18 |
5) Call Destroy when the background is no longer required (.onGUIEnd for example) |
| 19 |
|
| 20 |
Notes |
| 21 |
~~~~~ |
| 22 |
|
| 23 |
* This plugin requires NSIS 2.42 and above. |
| 24 |
|
| 25 |
* Do not call SetBg (which creates the window) from a section or a function called by a section. |
| 26 |
BgImge must be run from the GUI thread as the installation thread is not built to handle GUI. |
| 27 |
|
| 28 |
Available functions |
| 29 |
~~~~~~~~~~~~~~ |
| 30 |
|
| 31 |
SetBg [/FILLSCREEN|/TILED] path_to_bitmap |
| 32 |
SetBg /GRADIENT R G B R G B |
| 33 |
Sets the background and creates the window if necessary |
| 34 |
Use /FILLSCREEN to make the image fill the screen |
| 35 |
Use /TILED to set a tiled background |
| 36 |
Use /GRADIENT to set a gradient background |
| 37 |
|
| 38 |
If SetReturn on was called returns "success" on the stack |
| 39 |
or an error string if there was an error |
| 40 |
|
| 41 |
Do not use in .onInit! |
| 42 |
|
| 43 |
AddImage [/TRANSPARENT R G B] path_to_bitmap X Y |
| 44 |
Adds an image to the background window at (X,Y) |
| 45 |
X and Y can be negative to specify distance from right/bottom |
| 46 |
Use /TRANSPARENT to make BgImage draw the image transparently |
| 47 |
Define the transparent color using R G B |
| 48 |
|
| 49 |
If SetReturn on was called returns "success" on the stack |
| 50 |
or an error string if there was an error |
| 51 |
|
| 52 |
AddText text font_handle R G B X Y X Y |
| 53 |
Adds text to the background window |
| 54 |
Use NSIS's CreateFont to create a font and pass it as font_handle |
| 55 |
Use R G B to set the text color |
| 56 |
The first X Y is for the top left corner of the text box |
| 57 |
The second X Y is for the bottom right corner of the text box |
| 58 |
X and Y can be negative to specify distance from right/bottoms |
| 59 |
|
| 60 |
If SetReturn on was called returns "success" on the stack |
| 61 |
or an error string if there was an error |
| 62 |
|
| 63 |
Clear |
| 64 |
Clears all of the current background, images and texts |
| 65 |
|
| 66 |
Destroy |
| 67 |
Destroys the current background window |
| 68 |
Destroy calls Clear automatically |
| 69 |
|
| 70 |
Sound [/WAIT|/LOOP] path_to_wav |
| 71 |
Sound /STOP |
| 72 |
Plays a wave file |
| 73 |
Use /WAIT to wait for the sound to finish playing |
| 74 |
Use /LOOP to loop the sound |
| 75 |
Use Sound /STOP to stop the loop |
| 76 |
|
| 77 |
SetReturn on|off |
| 78 |
Enable return values from SetBg, AddImage and AddText |
| 79 |
Default value is off because all of the possible errors |
| 80 |
are either things you should handle when debugging your script |
| 81 |
such as "can't load bitmap" or errors you can do nothing about |
| 82 |
such as "memory allocation error" |
| 83 |
|
| 84 |
Credits |
| 85 |
~~~~~~~ |
| 86 |
|
| 87 |
Coded by Amir Szekely, aka KiCHiK |
| 88 |
|
| 89 |
Ximon Eighteen, aka Sunjammer - Fixed window title bar issues |
| 90 |
iceman_k - Text idea and original implementation |
| 91 |
Lajos Molnar, aka orfanik - Tile idea and original implementation |
| 92 |
Jason Reis - Coding help |