public void Dispose() { try { _duplCapture.Dispose(); } catch { } finally { _duplCapture = null; } // Mouse Pointer disposed later to prevent errors. try { _mousePointer?.Dispose(); } catch { } finally { _mousePointer = null; } try { _editorSession.Dispose(); } catch { } finally { _editorSession = null; } }
public DesktopDuplicator(bool IncludeCursor, Output1 Output, IPreviewWindow PreviewWindow) { _duplCapture = new DuplCapture(Output); var bounds = Output.Description.DesktopBounds; var width = bounds.Right - bounds.Left; var height = bounds.Bottom - bounds.Top; _editorSession = new Direct2DEditorSession(width, height, PreviewWindow); if (IncludeCursor) { _mousePointer = new DxMousePointer(_editorSession); } }