Capture screen in one window

I am looking for an SDK, plugin or code that will write a specific window (hwnd). If possible, in C # or Java. Does anyone know if this exists? I was googling, but did not meet anything.

+6
source share
1 answer

Install Microsoft Expression Encoder 4 Service Pack 2 (SP2) .

Here is an example program for using it. A more complete sample comes with an SDK that is included in the download.

using System; using System.Drawing; using Microsoft.Expression.Encoder.ScreenCapture; // Added references to: // Microsoft.Expression.Encoder // Microsoft.Expression.Encoder.Types // Microsoft.Expression.Encoder.Utilities // WindowsBase // System.Drawing (for Rectangle) namespace scrcap { class Program { static void Main(string[] args) { ScreenCaptureJob job = new ScreenCaptureJob(); // You can capture a window by setting its coordinates here job.CaptureRectangle = new Rectangle(100, 100, 200, 200); // Include the mouse pointer in the captured video job.CaptureMouseCursor = true; // Output file; you can transcode the xesc file to something else later. // Note that this silently does nothing if the file already exists. job.OutputScreenCaptureFileName = @"C:\Users\arx\scrcap\capture.xesc"; // Do some capture job.Start(); // Wait for a keypress Console.ReadKey(); // And stop job.Stop(); } } } 
+4
source

Source: https://habr.com/ru/post/902458/


All Articles