BoboTiG / python-mss

An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
https://pypi.org/project/mss/
MIT License
1.01k stars 93 forks source link

Fixing Mouse Flicker when doing rapid Screenshots #179

Closed BanditTech closed 4 years ago

BanditTech commented 4 years ago

General information:

Description of the warning/error

This issue occurs when taking rapid screenshots of a fullscreen game. I have an issue of the mouse flickering on the screen, constantly disappearing and reappearing.

Full message

There is no error, it functions as intended and the output is the proper screen capture.

Other details

In order to resolve this issue I have manually adjusted the parameters of the capture within the windows.py file.

Excluding the value CAPTUREBLT ( 0x40000000 ) fixes the issue and allows the captures to happen rapidly without affecting the cursor.

The line is on 290 remove the " | CAPTUREBLT " and it resolves the issue.

BoboTiG commented 4 years ago

What you could do is simething like:

import mss.windows
mss.windows.CAPTUREBLT = 0

# And then you do the screenshot
import mss
# ...
BanditTech commented 4 years ago

Thank you, this fixes it in a much more elegant way than ablation. 👍

Boxylmer commented 1 year ago

Fastest issue I've ever found an immediate solution to. Thanks!