# Fast Bluestacks screenshots with pywin32
## pip install nescree32
### Tested against Windows 10 / Python 3.11 / Anaconda / BlueStacks
```PY
# 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()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/nescree32",
"name": "nescree32",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "utils,Bluestacks",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/19/98/411debfe901238b47efafd2329135f0ef94f652f01c115b8d6cc24d179dc/nescree32-0.10.tar.gz",
"platform": null,
"description": "\r\n# Fast Bluestacks screenshots with pywin32\r\n\r\n## pip install nescree32\r\n\r\n### Tested against Windows 10 / Python 3.11 / Anaconda / BlueStacks\r\n\r\n\r\n```PY\r\n# pywin32 is not listed in requirements.txt\r\n# install it using: pip install pywin32\r\n\r\nfrom nescree32 import get_screenshots_from_bluestacks\r\nimport cv2\r\n\r\n# INTER_NEAREST: int\r\n# INTER_LINEAR: int\r\n# INTER_CUBIC: int\r\n# INTER_AREA: int\r\n# INTER_LANCZOS4: int\r\n# INTER_LINEAR_EXACT: int\r\n# INTER_NEAREST_EXACT: int\r\n# INTER_MAX: int\r\n# WARP_FILL_OUTLIERS: int\r\n# WARP_INVERSE_MAP: int\r\n\r\ninterpolation = cv2.INTER_AREA\r\nshow_original_android_size = True\r\nbst_instance = \"Rvc64_37\"\r\nadb_path = r\"C:\\ProgramData\\chocolatey\\lib\\adb\\tools\\platform-tools\\adb.exe\"\r\nprintresults = False\r\nshow_fps = True\r\nfor (\r\n image,\r\n original_rect,\r\n start_x,\r\n start_y,\r\n width,\r\n height,\r\n end_x,\r\n end_y,\r\n adb_width,\r\n adb_height,\r\n) in get_screenshots_from_bluestacks(\r\n instance_to_automate=bst_instance,\r\n adb_path=adb_path,\r\n show_fps=show_fps,\r\n):\r\n if printresults:\r\n print(\r\n image.shape,\r\n original_rect,\r\n start_x,\r\n start_y,\r\n width,\r\n height,\r\n end_x,\r\n end_y,\r\n adb_width,\r\n adb_height,\r\n )\r\n if not show_original_android_size:\r\n # use this to automate via win32\r\n cv2.imshow(bst_instance, image)\r\n else:\r\n # use this to automate via adb.exe\r\n if adb_width == -1:\r\n adb_width = 900\r\n if adb_height == -1:\r\n adb_height = 1600\r\n image_original_adb = cv2.resize(\r\n image, (adb_width, adb_height), interpolation=interpolation\r\n )\r\n cv2.imshow(bst_instance, image_original_adb)\r\n\r\n if cv2.waitKey(1) & 0xFF == ord(\"q\"):\r\n break\r\ncv2.destroyAllWindows()\r\n\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Fast Bluestacks screenshots with pywin32",
"version": "0.10",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/nescree32"
},
"split_keywords": [
"utils",
"bluestacks"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "80ee48f2c1f9afcb4178758e0221b1325e9b5510af6aa5f63444940a04bdbb8a",
"md5": "a1b12f765772e608c68b2e8831da2b2e",
"sha256": "530f64e9b419f06833c19c702befa9657c2081b25d06381a7311e8ea7ba2127b"
},
"downloads": -1,
"filename": "nescree32-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a1b12f765772e608c68b2e8831da2b2e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 22301,
"upload_time": "2024-03-18T20:35:20",
"upload_time_iso_8601": "2024-03-18T20:35:20.946021Z",
"url": "https://files.pythonhosted.org/packages/80/ee/48f2c1f9afcb4178758e0221b1325e9b5510af6aa5f63444940a04bdbb8a/nescree32-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1998411debfe901238b47efafd2329135f0ef94f652f01c115b8d6cc24d179dc",
"md5": "bb3b92e9393439c122f70426ddd4a8f1",
"sha256": "ca8ef09fe94c3e043bc1d6dfcfebd629564537a80ba73fb5b87bab51a8ec4f02"
},
"downloads": -1,
"filename": "nescree32-0.10.tar.gz",
"has_sig": false,
"md5_digest": "bb3b92e9393439c122f70426ddd4a8f1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22032,
"upload_time": "2024-03-18T20:35:23",
"upload_time_iso_8601": "2024-03-18T20:35:23.497696Z",
"url": "https://files.pythonhosted.org/packages/19/98/411debfe901238b47efafd2329135f0ef94f652f01c115b8d6cc24d179dc/nescree32-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-18 20:35:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "nescree32",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "nescree32"
}