FRtcImage
Image properties.
USTRUCT(BlueprintType) struct FRtcImage { GENERATED_BODY() UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcImage") FString url = ""; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcImage") int x = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcImage") int y = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcImage") int width = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcImage") int height = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcImage") int zOrder = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|RtcImage") float alpha = 0; FRtcImage() {} FRtcImage(const agora::rtc::RtcImage& AgoraData) { url = UTF8_TO_TCHAR(AgoraData.url); x = AgoraData.x; y = AgoraData.y; width = AgoraData.width; height = AgoraData.height; zOrder = AgoraData.zOrder; alpha = AgoraData.alpha; } agora::rtc::RtcImage CreateAgoraData() const { agora::rtc::RtcImage AgoraData; char* URLCharPtr = new char[url.Len() + 1]; FMemory::Memcpy(URLCharPtr, TCHAR_TO_UTF8(*url), url.Len()); URLCharPtr[url.Len()] = '\0'; AgoraData.url = URLCharPtr; AgoraData.x = x; AgoraData.y = y; AgoraData.width = width; AgoraData.height = height; AgoraData.zOrder = zOrder; AgoraData.alpha = alpha; return AgoraData; } void FreeAgoraData(agora::rtc::RtcImage& AgoraData) const { if (AgoraData.url) { delete[] AgoraData.url; AgoraData.url = nullptr; } } };
This class sets the properties of the watermark and background images in the live video.
Attributes
- url
- The HTTP/HTTPS URL address of the image in the live video. The maximum length of this parameter is 1024 bytes.
- x
- The x-coordinate (px) of the image on the video frame (taking the upper left corner of the video frame as the origin).
- y
- The y-coordinate (px) of the image on the video frame (taking the upper left corner of the video frame as the origin).
- width
- The width (px) of the image on the video frame.
- height
- The height (px) of the image on the video frame.
- zOrder
- The layer index of the watermark or background image. When you use the watermark array to add a watermark or multiple watermarks, you must pass a value to zOrder in the range [1,255]; otherwise, the SDK reports an error. In other cases, zOrder can optionally be passed in the range [0,255], with 0 being the default value. 0 means the bottom layer and 255 means the top layer.
- alpha
- The transparency of the watermark or background image. The range of the value is [0.0,1.0]:
- 0.0: Completely transparent.
- 1.0: (Default) Opaque.