How to drag-n-drop camera into plugin view

In Smart Client, I can drag-n-drop a camera from the panel list of cameras to a blank view in Live mode. When the camera is dragged to the view, the mouse cursor changes to a plus icon indicating that the view will accept the drop.

I have a plugin that is similar to the RGBVideoEnhancement sample. To use the plugin, I change the mode to Setup, drag the plugin to the blank view, and click Setup button to leave the setup mode. The plugin has a list of cameras that I can select from while in setup mode and that works. But when I drag a camera from the panel list of cameras to the plug-in while in Live mode, the mouse cursor changes to a circle with a slash indicating that the view will not accept the drop. How can I extend my plugin to accept a drag-n-drop camera object message?

It is unfortunately so that the RGBVideoEnhancement sample does not support drag and drop.

You will have to implement 2 new event handlers for the events “DragEnter” and “DragDrop” (see https://msdn.microsoft.com/en-us/library/aa984430%28v=vs.71%29.aspx). The former for changing the cursor, the latter for extracting the camera GUID and populating the plugin with the correct camera.

I will try to make it here myself but it might take a couple of days. Meanwhile, look at this snippet which I found in our systems:

private void OnDragDrop(object sender, DragEventArgs e)

{

object list = e.Data.GetData(“VideoOS.RemoteClient.Application.DragDrop.DraggedDeviceIdList”);

if (list != null)

{

List listGuid = list as List;

if (listGuid != null && listGuid.Count > 0)

{

textBoxTo.Text = listGuid[0].ToString();

Item cameraItem = Configuration.Instance.GetItem(listGuid[0], Kind.Camera);

if (cameraItem != null)

textBoxTo.Text += “\r\n” + cameraItem.Name;

}

}

}

It shows an example of how to extract a GUID to get the id of a camera when dropping.

I have eventually been able to complete the work. You can download a ZIP file from here:

http://download.milestonesys.com/MIPSDK/Samples/DragAndDropEnabledPlugins/DragAndDropEnabledPlugins.zip