Updated on 2023-03-23 GMT+08:00

Customizing a Watermark for a Meeting

SetWaterMark

API Description

This API is used to customize a watermark. If not specified, the internal priorities are used to display the watermark.

Figure 1 Sample of a custom watermark

Precautions

  1. This API must be called before a meeting. Calling it during a meeting does not take effect immediately.
  2. This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.
  3. If the enterprise-level watermark function is disabled, the customized watermark injection does not take effect.

Method Definition

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode SetWaterMark(const HwmWaterMarkInfo * wtInfo);

Callback Function

1
virtual void OnSetWaterMarkInjectInfoResult(hwmsdk::HwmErrCode ret, const char* reason) {};

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

wtInfo

Yes

HwmWaterMarkInfo

Set the watermark information.

Table 2 HwmWaterMarkInfo parameters

Parameter

Type

Description

content

char[]

Set the custom watermark to be injected.

color

HwmWaterMarkColorType

Set the watermark font color.

Table 3 Enumerated values of HwmWaterMarkColorType

Enumerated Value

Description

HWM_WATERMARK_COLOR_TYPE_LIGHT

Light #CCCCCC

HWM_WATERMARK_COLOR_TYPE_STANDARD

Standard #999999

HWM_WATERMARK_COLOR_TYPE_DARKER

Dark #666666

Return Values

Table 4 Return values

Type

Description

HwmErrCode

If 0 is returned, the operation is successful. If other values are returned, the operation fails. For details about values returned upon failures, see Common Error Codes.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
/**
* Set watermarks
*/
void demoWaterMarkInfoDlg::OnBnClickedSetWaterMarkInjectInfo()
{
    std::string content = "admin@1";
    unsigned int color = hwmsdkagent::HWM_WATERMARK_COLOR_TYPE_LIGHT;
    hwmsdkagent::HwmWaterMarkInfo injectInfo = {0};

    strncpy_s(injectInfo.content, content.c_str(), HWM_MAX_WATERMARK_CONTENT_LEN);
    injectInfo.color = (hwmsdkagent::HwmWaterMarkColorType)color;
    int ret = hwmsdkagent::SetWaterMark(&injectInfo);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("SetWaterMark inject info failed"));
    }
}