This module takes screenshots of BlueStacks using the win32 API, resizes and crops them to the same size of an ADB screenshot.
Project description
This module takes screenshots of BlueStacks using the win32 API, resizes and crops them to the same size of an ADB screenshot.
You can easily get more than 100 FPS, but the BlueStacks window may not be minimized! You can put it in the background, but don't minimize it!
Once you have called calculate_crop(), you can move the BlueStacks window, but don't resize it!
pip install bluestacks-fast-screenshot
from bluestacks_fast_screenshot import BluestacksScreencapWin32
import re
import cv2
bluestacksfast = BluestacksScreencapWin32(
deviceserial="localhost:5735",
adb_path="C:\\Users\\Gamer\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe",
hwnd=None,
window_text=re.compile(r".*bluestacks.*", flags=re.IGNORECASE),
show_capture_keys="ctrl+alt+z", # starts cv2.imshow() - can be enabled/disabled by pressing ctrl+alt+z
show_fps_keys="ctrl+alt+f", # show the fps rate - can be enabled/disabled by pressing ctrl+alt+f
kill_screencap_keys="ctrl+alt+x", # kills the capture process
)
for pic in bluestacksfast.calculate_crop(
mincrop=15, # Limit the crop size here, but be careful, if the value is too high, the picture will not be cropped properly
maxcrop=70, # Limit the crop size here, but be careful, if the value is too low, the picture will not be cropped properly
interpolation=cv2.INTER_AREA,
).get_converted_screenshots(
interpolation=cv2.INTER_AREA, sleeptime=None, force_cropcoords_update=False
):
# print('do something here', end='\r')
print(pic.shape, end="\r")
bluestacksfast.kill_screencap() # if you break out of the loop, stop capturing
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for bluestacks_fast_screenshot-0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7047b2051a659da593a3a09d91a368874f3f7be93ca654579fe9d8dcfa27e33 |
|
MD5 | 93d84f70bb31173a7c94a653e90957d7 |
|
BLAKE2b-256 | ccc9872a315999097960375a64f7ea38ff99d7fa4d6a0daa6d0079aecdf1b3f1 |
Close
Hashes for bluestacks_fast_screenshot-0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c250c6a5f78224693ab468fecf21574b19b45e08f2b080268e1cf1d0ba7faa87 |
|
MD5 | b9348d052c2351543359fea4800955ce |
|
BLAKE2b-256 | 8fee8c5edf54a270fe3a19566f95a23354e0bba406dbe47a35044ab125032cc1 |