-
Notifications
You must be signed in to change notification settings - Fork 68
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
[Question] I try to take the screen on mac os but dont works #44
Comments
I think I figured out why this happens. Let's say we have a screen whose resolution is 4x3.
where
However on macOS, the incoming frame buffer actually looks like this:
Now we're in a slightly different situation.
which explains why @iddar's screenshot got skewed and have alternating colors every line. Fixing this issue in the example code on macOS is pretty easy. let stride = buffer.len() / h; to this: let stride = w * 4; Glitched screenshot that I could reproduce on my machine: And the screenshot I took with the fix applied: It would be awesome if we can have something like an iterator that can iterate over non-junk |
I forgot to mention that my machine's got M1 in it too. |
I can't seem to get an appropriate screenshot even after the stride change |
@rjooske After testing for a bit it looks like when I use a monitor the output is a clear image but when its just the macbook screen it looks like this - Any ideas? |
@1saf That's interesting. I also have an external monitor (Dell S2722QC, for the record) and did some more digging around. What I found is the following:
It seems that the screenshot gets messed up only when you take the screenshot of the built-in monitor, and you use non-default scaling. Although the result could be different depending on what monitor you use. (I only have one so I can't test it now) My initial guess was that |
So no way to work around it? :'( I tried different solutions in regards to scaling. |
I'm using built in monitor, default scaling and am able to get a good picture, but it's not a high res capture. |
I try to take the screen on mac os (run on MacBook Pro M1), I follow the sample code here
But the result is
I test in Linux, the code works great.
Do you have any idea what could be going on?
The text was updated successfully, but these errors were encountered: