Class ScreenCaptureSourceSettings
- Namespace
- VisioForge.Core.Types.VideoCapture
- Assembly
- VisioForge.Core.dll
Provides configuration settings for screen capture operations, including capture area, frame rate, and visual enhancements.
public class ScreenCaptureSourceSettingsInheritance
Inherited Members
Remarks
This class encapsulates all the settings required to configure screen capture functionality, supporting both full-screen and region-based capture modes. It provides fine-grained control over the capture process, including performance optimizations and visual enhancements.
The settings support various capture scenarios: - Full screen capture across multiple displays - Specific window capture using window handles - Custom region capture with coordinate specification - Mouse cursor capture with optional highlighting effects
On Windows 8 and later, the Desktop Duplication API can be enabled for improved performance and lower CPU usage compared to traditional GDI-based capture methods.
Constructors
ScreenCaptureSourceSettings()
Initializes a new instance of the VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings class with default values.
public ScreenCaptureSourceSettings()Remarks
The default configuration captures the full primary screen at 10 frames per second without
the mouse cursor. The capture area is initially set to 640x480 pixels for non-fullscreen mode,
though this is overridden when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.FullScreen is true.
Properties
AllowDesktopDuplicationEngine
Gets or sets a value indicating whether the Desktop Duplication API should be used for screen capture.
public bool AllowDesktopDuplicationEngine { get; set; }Property Value
Remarks
The Desktop Duplication API is available on Windows 8 and later versions. It provides significantly better performance and lower CPU usage compared to GDI-based capture methods.
When this option is enabled but the API is not available (e.g., on Windows 7), the system will automatically fall back to GDI capture.
Bottom
Gets or sets the bottom boundary coordinate for the screen capture area.
public int Bottom { get; set; }Property Value
Remarks
This property is only used when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.FullScreen is set to false.
The value should be greater than VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.Top to define a valid capture area.
ColorModeColor
Gets or sets the fill color used in Color capture mode.
public Color ColorModeColor { get; set; }Property Value
Remarks
This property only takes effect when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.Mode is set to VisioForge.Core.Types.VideoCapture.ScreenCaptureMode.Color.
DisplayIndex
Gets or sets the zero-based index of the display monitor to capture.
public int DisplayIndex { get; set; }Property Value
Remarks
In multi-monitor setups, this property determines which display to capture. The index corresponds to the system's display enumeration order. Use 0 for the primary display, 1 for the first secondary display, and so on.
FrameRate
Gets or sets the frame rate at which the screen will be captured.
public VideoFrameRate FrameRate { get; set; }Property Value
Remarks
Higher frame rates provide smoother capture but require more system resources. Common values include 10, 15, 25, or 30 frames per second. The actual achievable frame rate may be limited by system performance.
FullScreen
Gets or sets a value indicating whether to capture the entire screen or a specific region.
public bool FullScreen { get; set; }Property Value
Remarks
When set to true, the coordinate properties are ignored and the entire display
specified by VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.DisplayIndex is captured.
GrabMouseCursor
Gets or sets a value indicating whether the mouse cursor should be included in the capture.
public bool GrabMouseCursor { get; set; }Property Value
Remarks
When enabled, the mouse cursor will be rendered on top of the captured screen content. This setting works in conjunction with the mouse highlighting features for enhanced visibility.
Left
Gets or sets the left boundary coordinate for the screen capture area.
public int Left { get; set; }Property Value
Remarks
This property is only used when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.FullScreen is set to false.
The coordinate is relative to the top-left corner of the specified display.
Mode
Gets or sets the screen capture mode that determines what content is captured.
public ScreenCaptureMode Mode { get; set; }Property Value
Remarks
The capture mode determines whether to capture the entire screen, a specific window, or use other specialized capture methods. This property works in conjunction with other settings like VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.WindowHandle for window-specific capture.
MouseHighlight
Gets or sets a value indicating whether to display a visual highlight effect around the mouse cursor.
public bool MouseHighlight { get; set; }Property Value
Remarks
When enabled, a colored circle appears around the mouse cursor to make it more visible in screen recordings. This is particularly useful for tutorial videos or demonstrations. The highlight appearance can be customized using the related properties.
MouseHighlightColor
Gets or sets the color of the mouse highlight circle.
public Color MouseHighlightColor { get; set; }Property Value
Remarks
This property only takes effect when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.MouseHighlight is set to true.
Choose a color that provides good contrast with your typical screen content.
MouseHighlightDuration
Gets or sets the duration for which the mouse highlight remains visible after a click.
public TimeSpan MouseHighlightDuration { get; set; }Property Value
Remarks
This property determines how long the highlight effect persists after a mouse click, helping viewers notice where clicks occur. The highlight gradually fades out over this duration. This property only takes effect when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.MouseHighlight is enabled.
MouseHighlightOpacity
Gets or sets the opacity level of the mouse highlight effect.
public double MouseHighlightOpacity { get; set; }Property Value
Remarks
This property controls the transparency of the highlight circle, allowing the underlying screen content to show through. Lower values create a more subtle effect, while higher values make the highlight more prominent.
MouseHighlightRadius
Gets or sets the radius of the mouse highlight circle in pixels.
public int MouseHighlightRadius { get; set; }Property Value
Remarks
This property determines the size of the circular highlight area around the mouse cursor.
Larger values create a bigger highlight area, making the cursor more prominent in the capture.
This property only takes effect when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.MouseHighlight is set to true.
MouseHighlightSize
Gets or sets the thickness of the mouse highlight circle border in pixels.
public int MouseHighlightSize { get; set; }Property Value
Remarks
This property controls how thick the highlight circle's border appears.
Larger values create a more prominent highlight effect. This property only
takes effect when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.MouseHighlight is set to true.
PictureData
Gets or sets the BGRA32 image data to use as the video source in Picture capture mode.
[JsonIgnore]
public byte[] PictureData { get; set; }Property Value
- byte[]
Remarks
This property is only used when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.Mode is set to VisioForge.Core.Types.VideoCapture.ScreenCaptureMode.Picture. The data should be in BGRA32 format (4 bytes per pixel: Blue, Green, Red, Alpha).
Right
Gets or sets the right boundary coordinate for the screen capture area.
public int Right { get; set; }Property Value
Remarks
This property is only used when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.FullScreen is set to false.
The value should be greater than VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.Left to define a valid capture area.
Top
Gets or sets the top boundary coordinate for the screen capture area.
public int Top { get; set; }Property Value
Remarks
This property is only used when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.FullScreen is set to false.
The coordinate is relative to the top-left corner of the specified display.
WindowHandle
Gets or sets the handle of the window to capture when using window-specific capture mode.
[JsonIgnore]
public nint WindowHandle { get; set; }Property Value
Remarks
This property is only used when VisioForge.Core.Types.VideoCapture.ScreenCaptureSourceSettings.Mode is set to capture a specific window. The handle must refer to a valid window that exists at the time of capture. This property is not serialized to JSON.
Methods
ToString()
Returns a string representation of the current screen capture settings.
public override string ToString()Returns
- string
-
A string describing the capture mode and frame rate. For fullscreen mode, returns "Fullscreen@{fps}fps". For region capture, returns "{left}x{top}x{right}x{bottom}@{fps}fps".
Remarks
This method provides a concise summary of the capture configuration, useful for logging or displaying the current settings to users.