Files
puzzles/icons/screenshot.sh
Simon Tatham 197c2ebc12 Aha, this seems to be a more sensible way of getting screenshots:
instead of having the puzzle binary export its window ID to a script
which then runs xwd, we can use the gdk-pixbuf library to have the
puzzle binary _itself_ read its own internal pixmap and save it
straight to a PNG. How handy. And faster, and less timing-sensitive.

[originally from svn r7022]
2006-12-27 15:21:55 +00:00

26 lines
650 B
Bash
Executable File

#!/bin/sh
# Generate a screenshot from a puzzle save file. Takes the
# following arguments, in order:
#
# - the name of the puzzle binary
# - the name of the save file
# - the name of the output image file
# - (optionally) the proportion of the next move to redo before
# taking the screenshot.
#
# This script requires access to an X server in order to run, but
# seems to work fine under xvfb-run if you haven't got a real one
# available (or if you don't want to use it for some reason).
binary="$1"
save="$2"
image="$3"
if test "x$4" != "x"; then
redo="--redo $4"
else
redo=
fi
"$binary" $redo --screenshot "$image" --load "$save"