How to draw lines on the video streams in Smart Client?

In the Smart Client, inside a plugin, we want to draw lines (shapes) on cameras’ video streams in real-time as shown in the figure below.

Please have a look at this sample: https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/activeelementsoverlay/readme.html&tree=tree_1.html