Created
April 13, 2019 17:27
-
-
Save 3110/d513d089ef0074f77e9d66e17c967190 to your computer and use it in GitHub Desktop.
Windowsでロボホンの画面(背面LCD・プロジェクタ)をPNGでキャプチャします。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM ------------------------------------------------------------------------------ | |
REM ロボホンの画面(背面LCD・プロジェクタ)をPNGでキャプチャします。 | |
REM | |
REM 以下の外部コマンドをインストールしてパスを通しておいてください。 | |
REM * GraphicsMagick | |
REM http://www.graphicsmagick.org/ | |
REM * Android Debug Bridge(ADB) | |
REM https://developer.android.com/studio/command-line/adb?hl=JA | |
REM | |
REM robohon-capture.bat [-p] [filename] | |
REM | |
REM filenameを省略した場合,capture.pngになります。 | |
REM プロジェクタの表示をキャプチャする場合はpオプションを指定してください。 | |
REM ----------------------------------------------------------------------------- | |
setlocal | |
set capture=capture.png | |
set opts=-rotate 90 -crop 720x960 | |
if "%1"=="-p" ( | |
set opts=-rotate 180 | |
if not "%2"=="" ( | |
set capture=%2 | |
) | |
) else ( | |
if not "%1"=="" ( | |
set capture=%1 | |
) | |
) | |
set filename=/sdcard/%capture% | |
adb shell screencap -p %filename% | |
adb pull %filename% > nul 2>&1 | |
adb shell rm %filename% | |
gm convert %opts% %capture% %capture% | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment