Skip to content

Build improved screenshot API #1342

@pushfoo

Description

@pushfoo

Enhancement request:

tl;dr add beginner-friendly screenshot functionality with reasonable defaults

What should be added/changed?

The minimum

A function that grabs the image from the screen and immediately writes it to disk. It should meet the following requirements:

  1. Calling with zero arguments saves a screenshot to the current working directory with a reasonable time stamp format such as "%windowname_%Y%m%d_%H%M_%S_%f.jpg"
  2. Accepts the same optional bounds arguments as get_image
  3. Accepts an optional save_path argument that directly specifies the directory to save to or filename to use, overriding any formatting in the latter case
  4. Accepts an optional time_format argument to override the default timestamp format.

Additional features

We may also want to add :

  • A screenshot manager object that allows setting a default filename / timestamp format
  • Queuing features that allow multiple screenshots to queued up before writing to disk at a specified time, such as on game exit to avoid slow disk access during gameplay
  • Integration with the pyglet event system (example: take a screenshot whenever event or condition X happens)
  • Integrations with video format libraries to automatically assemble a movie of the screenshots Moved to Video Capture in Arcade #1349

What would it help with?

  1. Reduce the number of tools users need to install or learn to get help
  2. Make the cross-platform experience much less confusing
  3. Make Documentation: Add guide on taking screenshots & recordings #1338 far easier to write

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions