private void Dispose(bool disposing) { if (!disposed) { if (disposing) { NativeMethods.cvDestroyWindow(name); mouseCallback = null; drawCallback = null; if (trackbars != null) { trackbars.Clear(); trackbars = null; } disposed = true; } } }
internal static extern void cvSetMouseCallback(string window_name, _CvMouseCallback on_mouse, IntPtr param);
/// <summary> /// Assigns a callback for mouse events. /// </summary> /// <param name="onMouse"> /// The callback method that will handle mouse events of this named window. /// </param> public void SetMouseCallback(MouseCallback onMouse) { mouseCallback = (evt, x, y, flags, param) => onMouse(evt, x, y, flags); NativeMethods.cvSetMouseCallback(name, mouseCallback, IntPtr.Zero); }