# WatermarkRatio (/zh-CN/api-reference/rtc/csharp-windows/class-watermarkratio)

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

<a id="class_watermarkratio__prototype"></a>

```csharp
public class WatermarkRatio
    {
        public WatermarkRatio()
        {
            xRatio = 0.0f;
            yRatio = 0.0f;
            widthRatio = 0.0f;
        }

        public WatermarkRatio(float x, float y, float width)
        {
            xRatio = x;
            yRatio = y;
            widthRatio = width;
        }
        public float xRatio { set; get; }
        public float yRatio { set; get; }
        public float widthRatio { set; get; }
    }
```

<a id="class_watermarkratio__detailed_desc"></a>

### 详情 [#详情]

水印在屏幕中的位置和大小由 xRatio、yRatio 和 widthRatio 共同决定：

- (xRatio, yRatio) 指水印左上角的坐标，决定水印左上角到屏幕左上角的距离。
- widthRatio 决定水印的宽度。

<a id="class_watermarkratio__parameters"></a>

## 属性 [#属性]

<ParameterList>
<a id="xratio"></a>
<Parameter name="xRatio">

水印左上角的 x 坐标。以屏幕左上角为原点，x 坐标为水印左上角相对于原点的横向位移。取值范围为 [0.0,1.0]，默认值为 0。

</Parameter>
<a id="yratio"></a>
<Parameter name="yRatio">

水印左上角的 y 坐标。以屏幕左上角为原点，y 坐标为水印左上角相对于原点的纵向位移。取值范围为 [0.0,1.0]，默认值为 0。

</Parameter>
<a id="widthratio"></a>
<Parameter name="widthRatio">

水印的宽度。SDK 会根据该参数值计算出等比例的水印高度，确保放大或缩小后的水印图片不失真。取值范围为 [0.0,1.0]，默认值为 0，代表不显示水印。

</Parameter>
</ParameterList>
