BgImage.txt 3.0 KB

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