Hi John,
There's
a DevTools command, which takes a png screenshot of the rendered page as displayed in a browser window. We use this command to take screenshots in the headless_shell, see
HeadlessShell::captureScreenshot(), and we're currently
working on adding other controls for size and position of the screenshot area.
Depending on your use case, you can
2) embed headless_lib yourself and call the DevTools command through the C++ bindings (similar to what HeadlessShell does)
3) or connect to a renderer in a running chrome or headless_shell via the DevTools protocol (use --remote-debugging-port) and issue the command.
Cheers,
Eric