2009-11-26 15:34:16 +0000 2009-11-26 15:34:16 +0000
51
51
Advertisement

Tirar uma fotografia do ecrã a partir da linha de comando no Windows

Advertisement

Estou à procura de uma forma de tirar uma imagem do ecrã inteiro a partir da linha de comando. O sistema operativo é o Windows. Algo parecido com isto:

C:\>screenshot.exe screen1.png
Advertisement
Advertisement

Respostas (8)

41
41
41
2009-11-28 15:51:24 +0000

Esta pergunta já foi respondida, mas eu pensei em lançar isto também. (http://www.nirsoft.net/utils/nircmd.html) (freeware, infelizmente, não de código aberto) pode tirar screenshots da linha de comando, em conjunto com as numerosas outras funções que pode fazer.

Executando isto a partir da linha de comando ou no directório nircmd.exe ou se o copiou para a pasta do seu sistema32:

nircmd.exe savescreenshot screen1.png

faz o que lhe apetece. Pode também adiá-lo desta forma:

nircmd.exe cmdwait 2000 savescreenshot screen1.png

Que irá esperar 2000 milissegundos (2 segundos), e depois capturar e guardar a imagem do ecrã.

26
26
26
2009-11-26 16:16:13 +0000

Descarregar imagemagick . Estão incluídas muitas ferramentas de manipulação de imagem de linha de comando. importação permite capturar algum ou todo um ecrã e guardar a imagem num ficheiro. Por exemplo, para guardar o ecrã inteiro como um jpeg:

import -window root screen.jpeg

Se quiser usar o rato para clicar dentro de uma janela ou seleccionar uma região do ecrã & guardar um png, basta usar:

import box.png
18
Advertisement
18
18
2015-07-22 16:09:30 +0000
Advertisement

pode ser feito sem ferramentas externas (basta instalar a estrutura .net, que é instalada por defeito em tudo desde a vista e acima) - screenCapture.bat . É um programa C# auto-compilado e pode guardar a saída em poucos formatos e capturar apenas a janela activa ou o ecrã inteiro:

screenCapture- captures the screen or the active window and saves it to a file
Usage:
screenCapture filename.format [WindowTitle]

filename - the file where the screen capture will be saved
format - Bmp,Emf,Exif,Gif,Icon,Jpeg,Png,Tiff and are supported - default is bmp
WindowTitle - instead of capturing the whole screen will capture the only a window with the given title if there's such

Exemplos:

call screenCapture notepad.jpg "Notepad"
call screenCapture screen.png
10
10
10
2012-02-03 08:45:07 +0000

Experimente IrfanView .

Pode executá-lo através da linha de comando. Pode especificar qual a janela a capturar - como a janela inteira ou apenas a janela actual/activa - e também pode fazer algumas edições básicas, tais como aguçar, recortar ou redimensionar as imagens.

Aqui estão as opções de linha de comando , particularmente interessante é

i_view32 /capture=0 /convert=wholescreen.png
```.
6
Advertisement
6
6
2011-07-11 18:05:16 +0000
Advertisement

(http://code.google.com/p/screenshot-cmd/) tira uma imagem de uma área de trabalho ou de qualquer janela seleccionada por título de janela. É também possível seleccionar o rectângulo a capturar. O resultado é armazenado como um ficheiro png. (última actualização em 2011)

OPTIONS: -wt WINDOW\_TITLE Select window with this title. Title must not contain space (" "). -wh WINDOW\_HANDLE Select window by it's handle (representad as hex string - f.e. "0012079E") -rc LEFT TOP RIGHT BOTTOM Crop source. If no WINDOW\_TITLE is provided (0,0) is left top corner of desktop, else if WINDOW\_TITLE maches a desktop window (0,0) is it's top left corner. -o FILENAME Output file name, if none, the image will be saved as "screenshot.png" in the current working directory. -h Shows this help info.

Inspirado por: http://blog.mozilla.com/ted/2009/02/05/command-line-screenshot-tool-for-windows/

6
6
6
2009-11-26 15:42:42 +0000

Pode experimentar a ferramenta boxcutter :

usage: boxcutter [OPTIONS] [OUTPUT_FILENAME]

Saves a bitmap screenshot to 'OUTPUT_FILENAME' if given. Otherwise, 
screenshot is stored on clipboard by default.

OPTIONS
  -c, --coords X1,Y1,X2,Y2 capture the rectange (X1,Y1)-(X2,Y2)
  -f, --fullscreen fullscreen screenshot
  -v, --version display version information
  -h, --help display help message
2
Advertisement
2
2
2018-02-02 04:01:04 +0000
Advertisement

Pode usar a biblioteca Pillow python para tirar imagens do monitor primário

Passo1: instalar Pillow:

pip install -user pillow

Passo2: Tirar screenshots com o seguinte código:

from PIL import ImageGrab
img = ImageGrab.grab()
img.save('screenshot.bmp')
1
1
1
2009-11-27 14:44:11 +0000

Pode usar produto comercial snapit para tirar fantásticas imagens de ecrã da linha de comando.

Advertisement

Questões relacionadas

3
19
10
28
13
Advertisement