NsScreenshot plug-in: Difference between revisions
m (Added category links.) |
|||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{ | {{PageAuthor|lzandman}} | ||
== Links == | == Links == | ||
<attach>NsScreenshot.zip</attach><br> | <attach>NsScreenshot.zip</attach><br> | ||
== Description == | == Description == | ||
nsScreenshot is a NSIS-plugin created by | nsScreenshot is a NSIS-plugin created by Leon Zandman that can create a screenshot and save it to a Windows bitmap (BMP) file. | ||
== Usage == | == Usage == | ||
Line 14: | Line 11: | ||
*Full-screen capture | *Full-screen capture | ||
*Capture of a specific window (identified by window handle) | *Capture of a specific window (identified by its window handle) | ||
To capture the full screen and save it to 'c:\fullscreen.bmp' use the | To capture the full screen and save it to 'c:\fullscreen.bmp' use the | ||
Line 75: | Line 72: | ||
that should be easy to understand. | that should be easy to understand. | ||
== Important | == Important Notes == | ||
nsScreenshot always captures the full | ! nsScreenshot always captures the full screen. | ||
For capturing a specific window it will determine the rectangle | For capturing a specific window it will determine the rectangle | ||
occupied by that window and crop it out of the | occupied by that window and crop it out of the full screen picture, thus | ||
resulting in a screenshot of only that specific window. This means | resulting in a screenshot of only that specific window. This means | ||
that the window to be captured has to be visible | that the window to be captured has to be visible and on top when capturing! | ||
! nsScreenshot was created after some discussion in [http://forums.winamp.com/showthread.php?s=&threadid=149561 this] forum thread. | |||
nsScreenshot | ! nsScreenshot is not currently compatible with Microsoft Windows NT 6.x platform Operating Systems. See this SO Question for more details: http://stackoverflow.com/questions/11259775/nsis-plugin-nsscreenshot-not-working-in-windows-nt-6-x | ||
[[ | [[Category:Plugins]] |
Latest revision as of 10:12, 29 June 2012
Author: lzandman (talk, contrib) |
Links
NsScreenshot.zip (52 KB)
Description
nsScreenshot is a NSIS-plugin created by Leon Zandman that can create a screenshot and save it to a Windows bitmap (BMP) file.
Usage
It supports two types of screenshots:
- Full-screen capture
- Capture of a specific window (identified by its window handle)
To capture the full screen and save it to 'c:\fullscreen.bmp' use the following script:
; Put filename of screenshot onto stack Push "c:\fullscreen.bmp" ; Capture full screen nsScreenshot::Grab_FullScreen Pop $1 ; $1 contains "ok" if the screenshot was taken ; $1 contains "error" if something went wrong StrCmp $1 "ok" ok1 0 DetailPrint "nsScreenshot error" Goto next1 ok1: ; Get image dimensions from stack (only available when "ok") Pop $R1 Pop $R2 DetailPrint "nsScreenshot OK" DetailPrint "Dimensions: ($R1x$R2)" next1:
For capturing a specific window and saving it to 'c:\screenshot.bmp' use the following script:
; Put window handle of window to be captured ; onto stack. You can use FindWindow for this. ; We'll use the NSIS window in this example Push $HWNDPARENT ; Put filename of screenshot onto stack Push "c:\screenshot.bmp" ; Capture window nsScreenshot::Grab Pop $1 ; $1 contains "ok" if the screenshot was taken ; $1 contains "error" if something went wrong StrCmp $1 "ok" ok1 0 DetailPrint "nsScreenshot error" Goto next1 ok1: ; Get image dimensions from stack (only available when "ok") Pop $R1 Pop $R2 DetailPrint "nsScreenshot OK" DetailPrint "Dimensions: ($R1x$R2)" next1:
The distribution includes an example NSIS-script file that should be easy to understand.
Important Notes
! nsScreenshot always captures the full screen.
For capturing a specific window it will determine the rectangle occupied by that window and crop it out of the full screen picture, thus resulting in a screenshot of only that specific window. This means that the window to be captured has to be visible and on top when capturing!
! nsScreenshot was created after some discussion in this forum thread.
! nsScreenshot is not currently compatible with Microsoft Windows NT 6.x platform Operating Systems. See this SO Question for more details: http://stackoverflow.com/questions/11259775/nsis-plugin-nsscreenshot-not-working-in-windows-nt-6-x