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

Add Display.top() + left(), useful for combining multi-monitor captures #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nebual
Copy link
Contributor

@Nebual Nebual commented Apr 6, 2019

I wanted to take a screenshot of all my displays as one large image, but found I needed the relative positioning of the displays to arrange the resulting imagebuffers correctly.

top() and left() return i32's, where the first monitor is commonly at 0,0, and a second monitor positioned to the right and slightly up might be 1920,-100.
bottom() and right() are convenience methods, which should be equivalent to top() + height(), and thus aren't strictly required but are useful.

I have tested this on Windows and Linux, but haven't tried the Mac version (though it compiles on Appveyor at least). This is my first experience with FFI, so there might be a simpler approach to the return struct of CGDisplayBounds...

@Ameobea
Copy link
Contributor

Ameobea commented Apr 7, 2019

This would be awesome to have! One thing that my custom screenshot application built with scrap was lacking is multi-screen support. Thanks so much for this.

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