selectScreenCaptureTarget abstract method
void
selectScreenCaptureTarget(
- TRTCScreenCaptureSourceInfo source,
- TRTCRect rect,
- TRTCScreenCaptureProperty property
Select the screen or window to share (for desktop systems only)
After you get the sharable screens and windows through getScreenCaptureSources , you can call this API to select the target screen or window you want to share.
During the screen sharing process, you can also call this API at any time to switch the sharing target.
The following four sharing modes are supported:
- Sharing the entire screen:
- For
source
whosetype
isScreen
insourceInfoList
, setcaptureRect
to{0, 0, 0, 0}
.
- For
- Sharing a specified area:
- For
source
whosetype
isScreen
insourceInfoList
, setcaptureRect
to a non-nullptr value, e.g.,{100, 100, 300, 300}
.
- For
- Sharing an entire window:
- For
source
whosetype
isWindow
insourceInfoList
, setcaptureRect
to{0, 0, 0, 0}
.
- For
- Sharing a specified window area:
- For
source
whosetype
isWindow
insourceInfoList
, setcaptureRect
to a non-nullptr value, e.g.,{100, 100, 300, 300}
.
- For
Parameters:
- rect(TRTCRect):
- Specify the area to be captured.
- property(TRTCScreenCaptureProperty):
- Specify the attributes of the screen sharing target, such as capturing the cursor and highlighting the captured window.
- source(TRTCScreenCaptureSourceInfo):
- Specify sharing source.
Note:
- Setting the highlight border color and width parameters does not take effect on macOS.
Implementation
void selectScreenCaptureTarget(TRTCScreenCaptureSourceInfo source, TRTCRect rect, TRTCScreenCaptureProperty property);