Taking screenshots with GNU Screen

In the tmux and gist and trying to make students happier article, Jan-Piet Mens explains how to take screenshots with tmux.

As I still haven't migrated from Screen to tmux, I was wondering if this is also possible in Screen.
And turns out that there is indeed a similar mechanism that can be used in Screen.

By using the hardcopy command, Screen can write the current scrollback buffer to a file.
This can also be done for a detached session:

screen -X hardcopy -h /tmp/myscreenshot.txt

It's also possible to specify an explicit session and pane to use:

screen -p 0 -S 12345.pts-0.rocky -X hardcopy -h /tmp/myscreenshot.txt