Install DXcam with pip install dxcam, then create a camera and call grab(). The result is a NumPy array containing a captured desktop frame. DXcam is a Windows-focused library; its documented workflow is not cross-platform.
Take a one-time screenshot with DXcam
Run this in a Windows Python environment where DXcam is installed:
import dxcam
with dxcam.create() as camera:
frame = camera.grab()
if frame is None:
print("No new frame was available")
else:
print(frame.shape, frame.dtype)
camera.grab() returns a NumPy array when a new frame is available. By default, it can return None if the desktop has not produced a new frame since the last capture. If you want the latest frame even when it has not changed, use camera.grab(new_frame_only=False).
The with block releases capture resources when it exits. You can also explicitly call camera.release(); a released camera instance cannot be reused. See the DXcam project README for the documented API and current setup notes.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
Capture only part of the desktop
Pass a region as (left, top, right, bottom) to grab():
import dxcam
left, top, right, bottom = 200, 100, 900, 700
with dxcam.create() as camera:
frame = camera.grab(region=(left, top, right, bottom))
if frame is None:
print("No new frame was available")
else:
print("Captured region shape:", frame.shape)
These are desktop coordinates: left and top mark the region’s starting point, while right and bottom mark its far edges. Choose values that fit the target display and the area you want; monitor dimensions vary, so do not assume a particular resolution.
Read frames continuously
For a stream of desktop frames, start DXcam’s capture thread, read its newest frame as needed, and stop capture when the consumer is done:
Rank #2
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
import time
import dxcam
with dxcam.create() as camera:
camera.start(target_fps=60)
try:
for _ in range(120):
frame = camera.get_latest_frame()
if frame is not None:
# Process or store the NumPy array here.
print(frame.shape)
time.sleep(1 / 60)
finally:
camera.stop()
start() runs a polling thread and stores frames in an in-memory ring buffer. get_latest_frame() reads the latest available frame. If timing matters, get_latest_frame(with_timestamp=True) returns a frame with its timestamp.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Choose video mode deliberately
With video_mode=True, DXcam fills the ring buffer at the requested target FPS by repeating the previous frame when Windows has not rendered a new one. That can be useful when a downstream video pipeline expects regularly spaced frames, but repeated frames are not new screen updates. Without video mode, frame availability follows new desktop frames.
Size the buffer for your consumer
The documented default ring-buffer size is 8. Set max_buffer_len when creating the camera if the consumer needs a different buffer length. Frames occupy memory, and once the buffer is full, newer frames overwrite older ones; a slow consumer can therefore miss frames. Choose a size that fits the capture rate, processing delay, and available memory rather than treating the buffer as permanent storage.
Rank #3
- Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
- 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
- ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
- ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
- ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
Choose a capture backend
DXcam documents two backends: dxgi, the default Desktop Duplication path, and winrt, which uses Windows Graphics Capture. The project recommends starting with DXGI for most workloads, especially one-time grabs. Try WinRT when cursor rendering is needed or its performance and application constraints appear to fit your setup better. The documentation does not establish a universal performance winner.
Microsoft describes the DXGI Desktop Duplication API as a way for applications to access desktop contents, including across monitor boundaries: Microsoft Learn: Desktop Duplication. DXcam’s own README is the source for its library-specific backend guidance.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallChoose the frame format and processing path
DXcam obtains BGRA frames and can process them into RGB, RGBA, BGR, BGRA, or GRAY output. The project recommends the OpenCV processor when OpenCV is installed and NumPy otherwise. BGRA is the leanest dependency path and does not require OpenCV; choose another format when your downstream code needs it. For example, the DXcam README uses BGR for writing video with OpenCV.
Rank #4
- Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
- Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
- Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
- EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
- Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.
Installation and compatibility notes
- Install: run
pip install dxcamin the Python environment you intend to use. - Check the supported wheels: the project README says its official Windows wheels are built for CPython 3.10 through 3.14. Availability can change, so check the current README and PyPI files if installation fails.
- Run a minimal capture: use
dxcam.create()followed bycamera.grab(), then check whether a frame was returned before processing it.
PyPI lists a CPython 3.14 Windows x86-64 wheel dated March 12, 2026; that dated file listing does not by itself guarantee compatibility with every Python build, architecture, or Windows configuration.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Performance, reliability, and cost
DXcam is free software installed as a Python package; its documented workflow captures the local Windows desktop and does not require a capture card. The project README promotes “Higher capture throughput (240+fps on 1080p).” That is a DXcam project claim, not an independently verified benchmark or a promise for a particular PC. Actual throughput depends on hardware, workload, backend, output processing, and how quickly your code consumes frames.
For sustained capture, keep processing work from blocking frame reads longer than your buffer can accommodate. If you need every frame for an analysis pipeline, monitor acquisition and consumer timing rather than assuming the latest-frame API preserves every intermediate frame. For video, test the chosen color format, frame cadence, and video-mode behavior with the application that will consume the output.
Best Value
- Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
Troubleshoot common DXcam problems
ModuleNotFoundError: No module named 'dxcam': install DXcam into the same Python environment that runs the script. If using a virtual environment, activate it before installing and running the code.- Installation cannot find a compatible wheel: verify that the environment is Windows and that its CPython version and architecture match an available wheel. Consult the current project README and PyPI file list; listed wheel support can change.
grab()returnsNone: by default this means no new frame has appeared since the previous capture. Request the latest frame withcamera.grab(new_frame_only=False)if an unchanged frame is acceptable.- The crop is wrong or empty: check that the tuple is ordered as
(left, top, right, bottom)and that its coordinates fit the target desktop dimensions. - The consumer misses frames: reduce processing delay, adjust
max_buffer_lenfor the workload, or redesign the consumer to keep up. Newer frames overwrite older ones when the in-memory ring buffer fills. - The cursor is absent or an application behaves differently: compare the documented backends. DXGI is the default starting point; test
winrtwhen cursor rendering or application fit makes it a better candidate.
Or skip the browser setup
DXcam captures a local Windows desktop. If your goal is instead to capture a web page from code, ScreenshotNeo is a website screenshot API: one GET request can return an image or PDF, without setting up a browser automation stack. For example, save this response as a WebP file:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. It removes cookie banners, popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up free for ScreenshotNeo.
Frequently Asked Questions
Does DXcam capture a browser page or the whole Windows desktop?
DXcam captures desktop frames. To capture a web page independently of the local desktop, use a website screenshot service or browser automation instead.
Can I use DXcam on macOS or Linux?
The documented DXcam workflow is Windows-focused and should not be treated as cross-platform.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesQuick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

