Skip to content

Suggestion: ClearTarget() #3

@jelling

Description

@jelling

First, thanks for writing this, it's very helpful.

For my use case I needed to clear the texture to stop sharing at times and I didn't see an obvious way to do it. My solution:

CaptureTexture.cs

        public void ClearTarget()
        {
            client?.ClearTarget();
        }

ClearTarget.cs

        public void ClearTarget()
        {
            if (IsDisposed) throw new ObjectDisposedException(nameof(CaptureClient));

            if (CurrentCapture != null)
            {
                CurrentCapture.Dispose();
                CurrentCapture = null;
            }

        }

Happy to do a PR if you're accepting them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions