Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate over all displays to create screenshot #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bmhenry
Copy link

@bmhenry bmhenry commented Oct 9, 2024

Uses scrap::Display::all to iterate over all available displays and construct a large buffer to hold all the BGRA structured pixels before referencing that in the screenshot ImgRef.

This likely needs review to (at least) move the timer commands if I misplaced them when adding code.

@owenthewizard
Copy link
Owner

Iirc when I worked on this way back, XCB could capture the entire screen (all monitors) at once, without needing to allocate memory to stitch them together manually, unless it was doing that behind the scenes anyway.
If possible I'd like to avoid the extra allocations.
Haven't looked into yet (not back until next week), but if scrap doesn't expose it I might need to go back to xcb FFI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants