Desktop capture
How to perform a desktop capture
- Set VideoSource = vs_ScreenRecording.
- Invoke StartPreview.
- Minimize the app (or hide it).
- Capture the desktop image to a memory bitmap or to a BMP or JPEG file by invoking CaptureFrameTo, or perform a screen recording as explained in the recording the screen with or without cursor chapter.
This can be quickly tested with the MainDemo.exe included in the package:
- Run MainDemo.exe.
- In the "video source" tab, select video source = "screen recording".
- Click StartPreview.
- Go to the "frame grabber" tab.
- Move the MainDemo.exe window to the bottom of the desktop to hide most of the MainDemo.exe app, keeping only the buttons of the "one shot frame capture" group visible.
- Click "BMP file" or "JPEG file" to capture the desktop image to a file, or "TBitmap" to capture it to a new window.
The app must be kept minimized (or not visible) to capture the desktop without capturing the app's window.
Note
If some special windows appear black in the captured image, enable the ScreenRecordingThroughClipboard property.