Skip to main content

Fast Bluestacks screenshots with pywin32

pip install nescree32

Tested against Windows 10 / Python 3.11 / Anaconda / BlueStacks

# pywin32 is not listed in requirements.txt
# install it using: pip install pywin32

from nescree32 import get_screenshots_from_bluestacks
import cv2

# INTER_NEAREST: int
# INTER_LINEAR: int
# INTER_CUBIC: int
# INTER_AREA: int
# INTER_LANCZOS4: int
# INTER_LINEAR_EXACT: int
# INTER_NEAREST_EXACT: int
# INTER_MAX: int
# WARP_FILL_OUTLIERS: int
# WARP_INVERSE_MAP: int

interpolation = cv2.INTER_AREA
show_original_android_size = True
bst_instance = "Rvc64_37"
adb_path = r"C:\ProgramData\chocolatey\lib\adb\tools\platform-tools\adb.exe"
printresults = False
show_fps = True
for (
    image,
    original_rect,
    start_x,
    start_y,
    width,
    height,
    end_x,
    end_y,
    adb_width,
    adb_height,
) in get_screenshots_from_bluestacks(
    instance_to_automate=bst_instance,
    adb_path=adb_path,
    show_fps=show_fps,
):
    if printresults:
        print(
            image.shape,
            original_rect,
            start_x,
            start_y,
            width,
            height,
            end_x,
            end_y,
            adb_width,
            adb_height,
        )
    if not show_original_android_size:
        # use this to automate via win32
        cv2.imshow(bst_instance, image)
    else:
        # use this to automate via adb.exe
        if adb_width == -1:
            adb_width = 900
        if adb_height == -1:
            adb_height = 1600
        image_original_adb = cv2.resize(
            image, (adb_width, adb_height), interpolation=interpolation
        )
        cv2.imshow(bst_instance, image_original_adb)

    if cv2.waitKey(1) & 0xFF == ord("q"):
        break
cv2.destroyAllWindows()

Metadata

Release files for nescree32 0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nescree32 0.10
File Size Uploaded Provenance Actions
nescree32-0.10.tar.gz 22.0 kB Without provenance Details for nescree32-0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nescree32 0.10
File Interpreter ABI Platform Actions
nescree32-0.10-py3-none-any.whl Python 3 none any Details for nescree32-0.10-py3-none-any.whl

Total release size: 44.3 kB

Release files / nescree32-0.10.tar.gz

Download URL nescree32-0.10.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ca8ef09fe94c3e043bc1d6dfcfebd629564537a80ba73fb5b87bab51a8ec4f02
BLAKE2b-256 checksum
How to use checksums
1998411debfe901238b47efafd2329135f0ef94f652f01c115b8d6cc24d179dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / nescree32-0.10-py3-none-any.whl

Download URL nescree32-0.10-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
530f64e9b419f06833c19c702befa9657c2081b25d06381a7311e8ea7ba2127b
BLAKE2b-256 checksum
How to use checksums
80ee48f2c1f9afcb4178758e0221b1325e9b5510af6aa5f63444940a04bdbb8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for nescree32 0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page