A command-line screenshot maker

When googling for a command-line screenshot maker, all I found was a bloated 3 MB tool and this nifty piece of code.
So I took it and added some command line options I needed:

-filename "my screeny.png"    file name (default: screenshot.png)
-encoder png                  file encoder: bmp/jpeg/gif/tiff/png (default: png)
-quality 100                  file quality for jpeg (between 0 and 100)
-resize 50                    image size, % of the original size (between 1 and 99)

Perhaps it’s gonna be useful to others, so I’m releasing it.
The code and a compiled binary are attached.

rar source.rar (2.97 KB)
rar binary.rar (20.24 KB)

GitHub repository:
https://github.com/RaMMicHaeL/cmdline-screenshot-maker

Posted in Programming by RaMMicHaeL at November 16th, 2009.

7 Responses to “A command-line screenshot maker”

  1. Will Knot B. Revealed Snr. says:

    Can’t see why no one has commented on this.
    Thank you. This shall be useful I’m sure :)

  2. Konstantine says:

    does not work with second monitor or selected screen area (screenshot-cmd and boxcutter can do this)
    does not work via PSExec (lsgrab works)

    • RaMMicHaeL says:

      This tool was written quite a while ago. I didn’t need the features you’ve mentioned, what I needed is capturing the whole screen with the smallest possible filesize.
      The tool allows to easily get a low-quality resized-by-half file, which has an extremely small size. Seems like none of the tools you’ve mentioned can do that.

      Anyway, the tool is open source, and you can add whatever features you like. If you plan on improving it, tell me and I’ll put it on GitHub for easier workflow.

  3. Konstantine says:

    Wow, did not expect such fast answer.
    I suck at Win API programming and have no expirience with GitHub but hmm…
    Well, I planned to try GitHub anyway, so if You do not change your mind, I would like to try adding these feratures.

  4. Kav says:

    hi,

    I am looking for command line screenshot capture program where I can capture any specific window (not full screen – using a script from inside that window). I am not familiar with Win API programs. Can this be added pl? TIA =- Kav

Leave a Reply