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

Hacer una captura de pantalla desde la línea de comandos en Windows

Advertisement

Estoy buscando una manera de tomar una captura de pantalla de toda la pantalla desde la línea de comandos. El sistema operativo es Windows. Algo así:

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

Respuestas (8)

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

Esta pregunta ya ha sido respondida, pero pensé en lanzar esto también. NirCmd (freeware, tristemente, no es de código abierto) puede tomar capturas de pantalla desde la línea de comandos, junto con las numerosas otras funciones que puede hacer.

Ejecutar esto desde la línea de comandos, ya sea en el directorio de nircmd.exe o si lo has copiado a tu carpeta system32:

nircmd.exe savescreenshot screen1.png

hace lo que quieres. También puedes retrasarlo así:

nircmd.exe cmdwait 2000 savescreenshot screen1.png

Eso esperará 2000 milisegundos (2 segundos), y luego capturará y guardará la pantalla.

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

Descargar imagemagick . Incluye muchas herramientas de manipulación de imágenes por línea de comandos. import permite capturar una parte o la totalidad de una pantalla y guardar la imagen en un archivo. Por ejemplo, para guardar toda la pantalla como un jpeg:

import -window root screen.jpeg

Si quiere usar el ratón para hacer clic dentro de una ventana o seleccionar una región de la pantalla y guardar un png, sólo tiene que usar:

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

se puede hacer sin herramientas externas (solo necesitas tener instalado el .net framework ,que viene instalado por defecto en todo lo de vista y superior) - screenCapture.bat . Es un programa autocompilado en C# y puedes guardar el resultado en varios formatos y capturar sólo la ventana activa o toda la pantalla:

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

Ejemplos:

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

Pruebe IrfanView .

Puedes ejecutarlo a través de la línea de comandos. Puedes especificar qué ventana capturar - como toda la ventana o sólo la ventana actual/activa - y también puedes hacer algunas ediciones básicas como afilar, recortar o redimensionar las imágenes.

Aquí están las opciones de la línea de comandos , particularmente interesante es

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

Screenshot-cmd toma una captura de pantalla de un escritorio o de cualquier ventana seleccionada por el título de la ventana. También es posible seleccionar el rectángulo a capturar. El resultado se almacena como un archivo png. (última actualización en 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

Puede probar la herramienta 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

Puedes usar la librería Pillow python para tomar capturas de pantalla del monitor primario

Paso1: instalar Pillow:

pip install -user pillow

Paso2: tomar capturas de pantalla con el siguiente código:

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

Puede utilizar el producto comercial snapit para realizar impresionantes capturas de pantalla desde la línea de comandos.

Advertisement

Preguntas relacionadas

3
19
10
28
2
Advertisement