Help Center/ Meeting/ Client SDK Reference/ Windows SDK/ API Reference/ UI Customization/ Customizing the Icon for a Specific Scenario
Updated on 2024-12-27 GMT+08:00

Customizing the Icon for a Specific Scenario

SetCustomUIImage

API Description

This API is used to customize the icon for a specific scenario.

Precautions

  1. 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.

Method Definition

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode SetCustomUIImage(const HwmCustomSceneImageInfoList* customSceneImageInfoList);

Callback Function

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

Parameter Description

Table 1 HwmCustomSceneImageInfoList description

Parameter

Type

Description

customSceneImageInfoListSize

unsigned int

Number of scenarios requiring icon customization.

customSceneImageInfoList

HwmCustomSceneImageInfo*

Custom icon details.

Table 2 HwmCustomSceneImageInfo description

Parameter

Type

Description

scene

HwmUICustomImageScene

Scenario requiring icon customization.

imagePath

char[]

Absolute path of the custom icon. For example, to/path/image.svg. SVG and PNG formats are supported.

UTF-8 encoding is required.

width

unsigned int

Custom icon width.

height

unsigned int

Custom icon height.

Table 3 Enumerated values of HwmUICustomImageScene

Enumerated Value

Description

CLOUD_RECORD_ICON_IMAGE_SCENE

Main icon of cloud recording in a meeting (in the recording pop-up menu, participant list, and sharing toolbar).

MAIN_WINDOW_CLOUD_RECORD_ICON_SCENE

Small cloud recording icon in the main window.

MAIN_WINDOW_CLOUD_RECORD_LOGO_SCENE

Large cloud recording logo in the main window.

Sample Code
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* Customize the icon for a specific scenario.
*/
void demoCustomSceneContentDlg::OnBnClickedOk()
{
    // Obtain the icon information.
    hwmsdkagent::HwmCustomSceneImageInfo imageInfo;
    int ccomboxIndex = m_comboBoxScene.GetCurSel();
    imageInfo.scene = static_cast<hwmsdkagent::HwmUICustomImageScene>(ccomboxIndex);
    CString tempCString;
    m_imagePath.GetWindowText(tempCString);
    strncpy_s(imageInfo.imagePath, CTools::UNICODE2UTF(tempCString.GetString()).c_str(), HWM_MAX_FILE_PATH_LEN);
    m_width.GetWindowText(tempCString);
    imageInfo.width = static_cast<unsigned int>(_ttoi(tempCString));
    m_height.GetWindowText(tempCString);
    imageInfo.height = static_cast<unsigned int>(_ttoi(tempCString));

    hwmsdkagent::HwmCustomSceneImageInfoList data{};
    data.customSceneImageInfoListSize = 1;
    data.customSceneImageInfoList = new (std::nothrow)hwmsdkagent::HwmCustomSceneImageInfo[data.customSceneImageInfoListSize];
    data.customSceneImageInfoList[0] = std::move(imageInfo);
    hwmsdk::HwmErrCode ret = hwmsdkagent::SetCustomUIImage(&data);
    if (ret != hwmsdk::HWM_COMMON_SUCCESS)
    {
        CTools::OutputRetStr("Custom scene content error");
    }
    // Release the struct memory.
    if (data.customSceneImageInfoList != nullptr)
    {
        delete data.customSceneImageInfoList;
        data.customSceneImageInfoList = nullptr;
    }
}