# ScreenCaptureConfiguration (/zh-CN/api-reference/rtc/csharp-windows/class-screencaptureconfiguration)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<a id="class_screencaptureconfiguration__prototype"></a>

```csharp
public class ScreenCaptureConfiguration
    {
        public bool isCaptureWindow;
        public long displayId;
        public Rectangle screenRect;
        public long windowId;

        public ScreenCaptureParameters @params;
        public Rectangle regionRect;

        public ScreenCaptureConfiguration()
        {
            this.isCaptureWindow = false;
            this.displayId = 0;
            this.windowId = 0;
        }

        public ScreenCaptureConfiguration(bool isCaptureWindow, long displayId, Rectangle screenRect, long windowId, ScreenCaptureParameters @params, Rectangle regionRect)
        {
            this.isCaptureWindow = isCaptureWindow;
            this.displayId = displayId;
            this.screenRect = screenRect;
            this.windowId = windowId;
            this.@params = @params;
            this.regionRect = regionRect;
        }
    }
```

<a id="class_screencaptureconfiguration__parameters"></a>

## 属性 [#属性]

<ParameterList>
<a id="iscapturewindow"></a>
<Parameter name="isCaptureWindow">

是否采集屏幕上的窗口：

<a id="class_screencaptureconfiguration__ul_ln3_hwd_mqb"></a>

- `true`：采集窗口。
- `false`：（默认）采集屏幕，不采集窗口。

</Parameter>
<a id="displayid"></a>
<Parameter name="displayId">

屏幕的 display ID。你无需设置该参数。

</Parameter>
<a id="screenrect"></a>
<Parameter name="screenRect">

待共享的屏幕相对于虚拟屏的位置。

<a id="class_screencaptureconfiguration__note_ifh_swd_mqb"></a>

:::caution
注意： 请仅在 Windows 设备上采集屏幕时使用该参数。
:::

</Parameter>
<a id="windowid"></a>
<Parameter name="windowId">

窗口 ID。

:::caution
注意： 请仅在采集窗口时使用该参数。
:::

</Parameter>
<a id="parameters"></a>
<Parameter name="parameters">

屏幕共享流的编码参数配置。详见 [ScreenCaptureParameters](/zh-CN/api-reference/rtc/csharp-windows/class-screencaptureparameters)。

</Parameter>
<a id="regionrect"></a>
<Parameter name="regionRect">

待共享区域相对于整个屏幕的位置。详见 [Rectangle](/zh-CN/api-reference/rtc/csharp-windows/class-rectangle)。如不填，则表示共享整个屏幕。如果设置的共享区域超出了屏幕的边界，则只共享屏幕内的内容。 如果将 Rectangle 中的 width 或 height 设为 0 ，则共享整个屏幕。

</Parameter>
</ParameterList>
