Annotation
Use annotation to draw over shared content. Both the user who is sharing and viewers can annotate during screen sharing.
Set up annotation
To check whether annotation is available, call isAnnotationFeatureSupport on the share helper. If you are the share owner, you can control whether viewers may annotate with disableViewerAnnotation.
IZoomVideoSDKShareHelper* pShareHelper = m_pVideoSDK->getShareHelper();
// Check whether the annotation feature is supported.
bool isSupported = pShareHelper->isAnnotationFeatureSupport();
// As the share owner, enable or disable annotation for viewers.
pShareHelper->disableViewerAnnotation(false);
If annotation is supported, set up screen sharing before continuing.
Start and stop annotation
To annotate, a viewer must first subscribe to a shared view, then pass the same view to createAnnotationHelper on the share helper to create an IZoomVideoSDKAnnotationHelper.
// Subscribe to the user's share pipe and render it into your view.
IZoomVideoSDKShareAction* pShareAction = pUser->getShareActionList()->GetItem(0);
IZoomVideoSDKRawDataPipe* pSharePipe = pShareAction->getSharePipe();
if (!pSharePipe) return;
pSharePipe->subscribe(ZoomVideoSDKResolution_Auto, this);
// Get the HWND for the associated share window.
void* hwnd = GetHWND();
// Create the annotation helper from the same view.
IZoomVideoSDKAnnotationHelper* pAnnotationHelper = m_pVideoSDK->getShareHelper()->createAnnotationHelper(hwnd);
if (pAnnotationHelper) {
pAnnotationHelper->startAnnotation();
// To stop annotation later:
pAnnotationHelper->stopAnnotation();
}
Annotation tools
Select a drawing tool with setToolType. The full list of tools is defined on ZoomVideoSDKAnnotationToolType.
// Get or set the tool type.
pAnnotationHelper->getToolType(toolType);
pAnnotationHelper->setToolType(ZoomVideoSDKAnnotationToolType_Pen);
// Get or set the tool color (unsigned long).
pAnnotationHelper->getToolColor(color);
pAnnotationHelper->setToolColor(color);
// Get or set the tool width (long).
pAnnotationHelper->getToolWidth(lineWidth);
pAnnotationHelper->setToolWidth(lineWidth);
ZoomVideoSDKAnnotationToolType includes the following values.
ZoomVideoSDKAnnotationToolType_NoneZoomVideoSDKAnnotationToolType_PenZoomVideoSDKAnnotationToolType_HighLighterZoomVideoSDKAnnotationToolType_AutoLineZoomVideoSDKAnnotationToolType_AutoRectangleZoomVideoSDKAnnotationToolType_AutoEllipseZoomVideoSDKAnnotationToolType_AutoArrowZoomVideoSDKAnnotationToolType_AutoRectangleFillZoomVideoSDKAnnotationToolType_AutoEllipseFillZoomVideoSDKAnnotationToolType_SpotLightZoomVideoSDKAnnotationToolType_ArrowZoomVideoSDKAnnotationToolType_ERASERZoomVideoSDKAnnotationToolType_TextboxZoomVideoSDKAnnotationToolType_Picker
For the full set, including the auto-stamp and vanishing-pen variants, see the IZoomVideoSDKAnnotationHelper reference.
Other annotation methods
You can undo or redo annotations, and clear all annotations, just your own, or just others' annotations.
pAnnotationHelper->undo();
pAnnotationHelper->redo();
pAnnotationHelper->clear(ZoomVideoSDKAnnotationClearType_All);
clear takes one of the following values.
ZoomVideoSDKAnnotationClearType_AllZoomVideoSDKAnnotationClearType_MyZoomVideoSDKAnnotationClearType_Others
Destroy annotation
When annotation is no longer required, destroy the helper with destroyAnnotationHelper on the share helper.
m_pVideoSDK->getShareHelper()->destroyAnnotationHelper(pAnnotationHelper);