Metadata-Version: 2.1
Name: bluestacks-fast-screenshot
Version: 0.11
Summary: This module takes screenshots of BlueStacks using the win32 API, resizes and crops them to the same size of an ADB screenshot.
Home-page: https://github.com/hansalemaos/bluestacks_fast_screenshot
Author: Johannes Fischer
Author-email: <aulasparticularesdealemaosp@gmail.com>
License: MIT
Keywords: bluestacks,adb,openCV,win32,screenshots,windows,bot,video,streaming
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Editors :: Text Processing
Classifier: Topic :: Text Processing :: General
Classifier: Topic :: Text Processing :: Indexing
Classifier: Topic :: Text Processing :: Filters
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
License-File: LICENSE.rst


### 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! 





```python

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



```



