What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a fixed rectangular area of the visible Windows desktop, create a Bitmap with the rectangle’s width and height, then use Graphics.CopyFromScreen to copy pixels from the screen position into the bitmap. The screen position is the source; (0, 0) is usually the destination inside the new bitmap. The example below saves the result as a PNG.

Capture a fixed rectangle with CopyFromScreen

Graphics.CopyFromScreen is the direct choice when your application already knows the rectangle to capture. It takes a source screen position, a destination position on the drawing surface, and the rectangle size. Make the destination bitmap exactly as wide and tall as the requested region; for a new bitmap, the destination normally starts at its upper-left corner, Point.Empty.

The following console-program example takes the rectangle coordinates and dimensions from command-line arguments and writes capture.png. It is intended for a Windows desktop process. The code follows Microsoft’s documented API pattern; it has not been independently compiled or tested here.

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.ComponentModel;

internal static class Program
{
    private static int Main(string[] args)
    {
        if (args.Length != 4 ||
            !int.TryParse(args[0], out int x) ||
            !int.TryParse(args[1], out int y) ||
            !int.TryParse(args[2], out int width) ||
            !int.TryParse(args[3], out int height) ||
            width <= 0 || height <= 0)
        {
            Console.Error.WriteLine("Usage: CaptureArea <x> <y> <width> <height>");
            return 2;
        }

        try
        {
            var area = new Rectangle(x, y, width, height);
            using var bitmap = new Bitmap(area.Width, area.Height);
            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                graphics.CopyFromScreen(area.Location, Point.Empty, area.Size);
            }

            bitmap.Save("capture.png", ImageFormat.Png);
            Console.WriteLine("Saved capture.png");
            return 0;
        }
        catch (Win32Exception ex)
        {
            Console.Error.WriteLine($"Screen capture failed: {ex.Message}");
            return 1;
        }
        catch (ExternalException ex)
        {
            Console.Error.WriteLine($"Could not save the image: {ex.Message}");
            return 1;
        }
        catch (ArgumentException ex)
        {
            Console.Error.WriteLine($"Invalid capture or image argument: {ex.Message}");
            return 1;
        }
    }
}

Run the program with four integers in this order: screen X coordinate, screen Y coordinate, width, and height. For example, CaptureArea 100 80 640 400 requests a 640-by-400-pixel rectangle whose upper-left point is at (100, 80) in screen coordinates. The output file is written to the process’s current working directory, so launch it from the directory where you want the PNG, or change the save path in the code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0

For this source code, include the System.Drawing and System.Drawing.Imaging namespaces. The API copies pixels to the drawing surface; it does not ask a user to choose an area or window. Provide a UI or another way to obtain x, y, width, and height if those values should not be fixed or entered manually.

Understand the coordinates and bitmap dimensions

  • Source point: area.Location identifies the upper-left corner of the requested region on the screen.
  • Destination point: Point.Empty places the copied pixels at the upper-left corner of the new bitmap. Destination coordinates are relative to that bitmap, not the desktop.
  • Size: area.Size specifies the width and height to copy. The destination bitmap is created with those same dimensions.
  • Image format: the example saves PNG with ImageFormat.Png. Change the file extension and corresponding format together if you choose another supported image format.

Screen coordinates need to describe a meaningful rectangle in the active display layout. The method’s arguments do not identify a particular monitor by name or select a window; they specify a position and size on the screen. If the requested area does not correspond to the intended visible content, first confirm the coordinates and dimensions used by your application.

When a rectangle is not the right interaction

The best approach depends on whether the application has a known rectangle, needs the operating system to present a selection interface, or needs successive frames rather than one image. Microsoft documents both the fixed-region CopyFromScreen pattern and the Windows.Graphics.Capture workflow; the reviewed Microsoft material does not provide a benchmark comparing their speed, quality, or latency.

Rank #2
Audio Express AXHDCAP 4K HDMI Video Capture Card, Cam Link Card Game Audio Adapter HDMI to USB 2.0 Record Capture Device for Streaming, Live Broadcasting, Video Conference, Teaching, Gaming
  • [Enhanced 4K-1080P Video Capture Experience] Capture the Magic: Elevate your video recordings to new heights with our upgraded anti-static 1080P Video Capture Card. Immerse yourself in stunning visuals, supporting HDMI input at 4K 60FPS and USB output for capturing in 1080P, complete with rich stereo sound. Enjoy crystal-clear video recordings, dynamic gaming live streams, and professional conference broadcasts. Note: HDMI resolution: Max input can be 3840×2160@30Hz / Video output resolution: Max output can be 1920×1080@30Hz
  • [Seamless Real-Time Preview] Stay in the Moment: Our advanced ultra-low latency technology ensures seamless real-time transmission of video streams. Experience instant, lag-free previews, allowing you to capture every detail precisely. Effortlessly record video directly to your hard disk, all without compromising on quality or introducing any delays.
  • [Versatility and Broad Compatibility] Your Creative Hub: Connect your DSLR, camcorder, or action camera to a wide range of operating systems, including Windows, MacOS, and Linux. Unlock a world of possibilities with real-time streaming to popular platforms like Twitch, Youtube, OBS, Zoom, Potplayer, and VLC, giving you the tools to share your content effortlessly.
  • [Effortless Plug and Play] Simplicity Redefined: Say goodbye to complex installations. Our plug-and-play design eliminates the need for drivers or external power supplies. Seamlessly integrate high-definition acquisition into various scenarios, whether it's educational recordings, immersive gaming, precise medical imaging, captivating live streams, or professional broadcasting.
  • [Seize Every Detail with Precision] Unleash your creativity and attention to detail with our video capture card. Capture every nuance, every color, and every moment with precision, thanks to the enhanced capabilities of our technology. Whether you're a content creator, a gamer, or a professional, our capture card empowers you to seize the finest elements and bring them to life in your recordings and live streams.
Need Approach Interaction and result
Capture a known screen rectangle once Graphics.CopyFromScreen Your code supplies the screen origin and dimensions and copies the region into a bitmap.
Let a user select a display or application window Windows.Graphics.Capture The system picker presents capture choices; the app receives a capture item and sets up a frame pool and capture session.
Capture successive frames Windows.Graphics.Capture The documented workflow uses a frame pool and session rather than a single bitmap copy.
Take a manual one-off screenshot Windows Snipping Tool The user opens the snapshot overlay with Windows+Shift+S and chooses rectangle, window, full-screen, or freeform capture.

Windows.Graphics.Capture is an API route for display or application-window capture. Microsoft’s guide describes a secure system picker and a yellow notification border around the actively captured item. Check GraphicsCaptureSession.IsSupported() before showing capture controls; Microsoft notes that availability is limited to Windows desktop devices and Windows Mixed Reality immersive headsets, and unsupported hardware can prevent capture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Microsoft’s WPF sample states that minimized windows may be enumerated but are not captured. That sample lists Windows 10 version 1903 or later, Windows 10 SDK 18362 or later, and .NET Framework 4.7.2 or later as its own requirements. Treat those as requirements for that sample, not as a complete compatibility guarantee for every Windows.Graphics.Capture application.

Handle display-layout and capture edge cases

A fixed rectangle is simple only when its coordinate system and target are clear. The available Microsoft material does not settle behavior for every mixed-DPI configuration, negative coordinates on a multi-monitor virtual desktop, protected content, or application-specific capture restrictions. If your app needs those cases, validate them against the Windows versions and coordinate-awareness configuration you support instead of assuming one coordinate conversion works everywhere.

Rank #3
Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P60FPS HDMI Capture Card for Streaming, Gaming, Video Recording Compatible with Switch, Xbox, PS4/5, OBS,iPad Mac OS Windows,Camera, Zoom(Silver)
  • 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
  • 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
  • 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
  • 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
  • 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.
  • Different monitor layouts: test with the actual monitor arrangement and requested screen coordinates. The example does not discover monitor bounds or reposition the rectangle automatically.
  • DPI scaling: determine whether the coordinates supplied by your application correspond to the screen coordinates expected for the target setup. The reviewed guidance does not provide a universal mixed-DPI correction.
  • Protected or restricted content: do not assume every visible or application-rendered surface can be copied. Validate capture behavior for the content and environment that matter to your users.
  • Window selection or ongoing capture: use the system-picker workflow rather than trying to turn a fixed screen rectangle into a window picker or frame stream.

Troubleshoot a failed or incorrect capture

The program reports a Win32Exception

Microsoft lists Win32Exception among the possible exceptions for CopyFromScreen. Keep the capture operation inside error handling, log the exception message for diagnosis, and check that the requested rectangle and desktop capture context are valid. Do not silently treat a failed copy as a successful image.

The image is blank or shows the wrong area

Check the four inputs independently: X, Y, width, and height. The first pair locates the source on screen; the second pair defines both the copied size and bitmap size. Also verify that the application is using the coordinate assumptions appropriate to its active display layout. The reviewed documentation does not identify one universal fix for mixed-DPI or multi-monitor discrepancies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The image dimensions are wrong

Create the bitmap with the same width and height passed to the copy operation. If you need a smaller output image, resize it as a separate image-processing step after capture; changing the source rectangle changes which screen pixels are requested, not merely the saved file’s display size.

Rank #4
Capture Card, 4K HDMI Video Capture Card, Game Capture Card, 1080P 60FPS Video Capture Device, HDMI to USB 3.0 Capture Card for Streaming, Work with Camera/Xbox/PS4/PS5/PC/OBS
  • 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
  • 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
  • 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
  • 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
  • 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.

The PNG is not where expected

A relative filename such as capture.png is resolved against the process’s current working directory, which may differ from the executable’s folder. Use an absolute output path or display/log the path your application saves.

The selected window is minimized or capture support is unavailable

The Microsoft WPF sample says minimized windows are not captured. For the Windows.Graphics.Capture route, call GraphicsCaptureSession.IsSupported() before exposing the picker flow, and account for unsupported devices rather than assuming the picker is available on every system.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

CopyFromScreen captures a region of the local Windows desktop. If what you need is instead an image or PDF of a web page by URL, ScreenshotNeo is a separate website screenshot API and MCP server; it does not select a rectangle from your desktop. One GET request can return a PNG, JPEG, WebP, or PDF.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Capture Card, USB Video Capture Card Device, Audio Video Converter Grabber for RCA to USB-Convert VHS Mini DV VCR Hi8 DVD to Digital, for PC TV Tape Player Camcorder, MAC Windows Vista Compatible
  • AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
  • Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
  • Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
  • Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
  • Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions

For a web-page screenshot, replace the target URL and add your API key. See the ScreenshotNeo API documentation for parameters and response details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Practical implementation checklist

  • Confirm the target is a fixed rectangle on the visible Windows desktop, rather than a user-selected window or a web page.
  • Obtain coordinates and dimensions in the screen coordinate system appropriate to your application.
  • Reject non-positive width or height before creating the bitmap.
  • Allocate a bitmap at the requested size and use the bitmap origin as the destination point.
  • Dispose of both Bitmap and Graphics, and handle capture and file-save exceptions separately where useful.
  • Test the display arrangements, DPI configurations, Windows editions, and content types your application actually supports.

For an application that only needs a known rectangle once, the bitmap-plus-CopyFromScreen pattern is the shortest documented route. Use the Windows capture picker when user selection or a frame-based workflow is central to the application, and validate platform-specific display behavior before relying on coordinates in production.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Is Windows Snipping Tool an API I can call from my C# application?

No. It is a manual Windows workflow for a person to take and save a screenshot; it is not an automated capture API for your application.

Does CopyFromScreen let the user draw a freeform selection?

No. It copies the rectangular region described by the source position and size. A user-driven display or window selection is a different workflow.

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.