Socket
Socket
Sign inDemoInstall

nativecap

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nativecap

Native screen capture module


Maintainers
1

Readme

nativecap

Take a screenshot with Python, natively, using a method based on that answer.

Setup

pip install nativecap

Usage

import nativecap

# outputs an array containing pixel colors in the BGRA format
buffer = nativecap.capture(top_left_x, top_left_y, width, height)

Example

import cv2
import numpy as np
import nativecap
import platform


x = 0
y = 0
width = 640
height = 480

buffer = nativecap.capture(x, y, width, height)
image = np.ctypeslib.as_array(buffer)
image = image.reshape(width, height, 4)

cv2.imshow("image", image)
cv2.waitKey(0)

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc