# Annotation Use annotation to draw over shared content. Both users and hosts can annotate during screen sharing. ## Set up annotation 1. Check if the annotation feature is supported. ```cpp // Create and initialize your videoSDK object (if not already done) IZoomVideoSDK* video_sdk_obj_ = CreateZoomVideoSDKObj(); ZoomVideoSDKErrors err = video_sdk_obj_->initialize(init_params); // To check if annotation feature is supported video_sdk_obj_->getShareHelper()->isViewerAnnotationDisabled(); // If you are the share owner, you can check if your viewer has annotation rights. video_sdk_obj_->getShareHelper()->isAnnotationFeatureSupport(); // If you are the share owner, you can enable or disable your viewer from annotation rights. video_sdk_obj_->getShareHelper()->disableViewerAnnotation(true/false); ``` If it is supported, continue. 1. Set up [screen sharing](/docs/video-sdk/linux/share/). Now you can use annotation in your implementation. ## Start and stop annotation In order to start annotation, the viewer must first have already subscribed to a shared view and input the same view to create a new [`IZoomVideoSDKAnnotationHelper`](https://marketplacefront.zoom.us/sdk/custom/linux/class_i_zoom_video_s_d_k_annotation_helper.html) from the share helper. ```cpp // Set the resolution. ZoomVideoSDKResolution resolution = ZoomVideoSDKResolution_Auto; // Get the share pipe for the user. IZoomVideoSDKRawDataPipe* pPipe = NULL; pPipe = pUser->GetSharePipe(); if (!pPipe) return; // Render the user's share stream into your view of choice. (This view is required for annotation) pPipe->subscribe(resolution, this); // Get name for associated share window const char* hwndChar = ":0-0(0,0,1920,1080)-34563456"; void* hwnd = reinterpret_cast(hwndChar); // hostname:display_number-screen_number(x, y, width, height)-winid " :0-0(0,0,1920,1080)-34563456 " // format of device_name: // hostname:display_number-screen_number(x, y, width, height)-winid " :0-0(0,0,1920,1080)-34563456 " // display_name hostname:display_number // screen_number use multi X11 virtural device, default is 0 // device_frame (x, y, width, height) // window_id winid // Create annotation helper using the same view above and check for permission again IZoomVideoSDKAnnotationHelper* annotationHelper = video_sdk_obj_->getShareHelper()->createAnnotationHelper(hwnd); if (annotationHelper) { annotationHelper.startAnnotation(); // To stop annotation later annotationHelper.stopAnnotation(); } ``` ## Annotation tools There are a list of annotation tools available. The full list of tools is located under `ZoomVideoSDKAnnotationToolType`. ```cpp // Enum of ZMVideoSDKAnnotationToolType ZMVideoSDKAnnotationToolType_None, ZMVideoSDKAnnotationToolType_Pen, ZMVideoSDKAnnotationToolType_HighLighter, ZMVideoSDKAnnotationToolType_AutoLine, ZMVideoSDKAnnotationToolType_AutoRectangle, ZMVideoSDKAnnotationToolType_AutoEllipse, ZMVideoSDKAnnotationToolType_AutoArrow, ZMVideoSDKAnnotationToolType_AutoRectangleFill, ZMVideoSDKAnnotationToolType_AutoEllipseFill, ZMVideoSDKAnnotationToolType_SpotLight, ZMVideoSDKAnnotationToolType_Arrow, ZMVideoSDKAnnotationToolType_ERASER, ZMVideoSDKAnnotationToolType_Textbox, ZMVideoSDKAnnotationToolType_Picker, ZMVideoSDKAnnotationToolType_AutoRectangleSemiFill, ZMVideoSDKAnnotationToolType_AutoEllipseSemiFill, ZMVideoSDKAnnotationToolType_AutoDoubleArrow, ZMVideoSDKAnnotationToolType_AutoDiamond, ZMVideoSDKAnnotationToolType_AutoStampArrow, ZMVideoSDKAnnotationToolType_AutoStampCheck, ZMVideoSDKAnnotationToolType_AutoStampX, ZMVideoSDKAnnotationToolType_AutoStampStar, ZMVideoSDKAnnotationToolType_AutoStampHeart, ZMVideoSDKAnnotationToolType_AutoStampQm ``` Upon selecting the tool, the user can also get or set the current tool's color or width. ```cpp // Get/set tool type annotationHelper.getToolType(); annotationHelper.setToolType(ZoomVideoSDKAnnotationToolType_Pen); // Get/set tool's color - unsigned long annotationHelper.getToolColor(); annotationHelper.setToolColor(value); // Get/set tool's width - long annotationHelper.getToolWidth(); annotationHelper.setToolWidth(value); ``` ## Other annotation methods You can also undo or redo annotations. And you can clear all annotations, just your own, or just others' annotations. ```cpp annotationHelper.undo(); annotationHelper.redo(); annotationHelper.clear(ZoomVideoSDKAnnotationClearType_All); // .all, .my, .others ``` For more information, see the [IZoomVideoSDKAnnotationHelper](https://marketplacefront.zoom.us/sdk/custom/linux/class_i_zoom_video_s_d_k_annotation_helper.html) and [IZoomVideoSDKShareHelper](https://marketplacefront.zoom.us/sdk/custom/linux/class_i_zoom_video_s_d_k_share_helper.html) references. ## Destroy annotation Once annotation is no longer valid or required, you can destroy it by calling the `destroyAnnotationHelper` method in the [IZoomVideoSDKShareHelper](https://marketplacefront.zoom.us/sdk/custom/linux/class_i_zoom_video_s_d_k_share_helper.html) interface. ```cpp video_sdk_obj_->getShareHelper()->destroyAnnotationHelper(annotationHelper); ```