Table of Contents

Class CropTarget

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The CropTarget interface of the {{domxref("Screen Capture API", "Screen Capture API", "", "nocode")}} provides a static method, FromElement(Element), which returns a CropTarget instance that can be used to crop a captured video track to the area in which a specified element is rendered.
[Value("CropTarget")]
public class CropTarget
Inheritance
CropTarget
Inherited Members

Remarks

Constructors

CropTarget()

public CropTarget()

Methods

FromElement(Element)

NOTE
Experimental
The fromElement() static method of the CropTarget interface returns a CropTarget instance that can be used to crop a captured video track to the area in which a specified element is rendered.
[Value("fromElement")]
public static Task<CropTarget> FromElement(Element element)

Parameters

element Element

Returns

Task<CropTarget>

A {{jsxref("Promise")}} that resolves to a CropTarget object instance, which can then be passed to CropTo(CropTarget?) to crop the video captured in the track to just the area the specified DOM element is rendered in.CropTarget objects are serializable. They can be passed to another document using mechanisms such as PostMessage(dynamic, string, List<Object>).

Remarks

Because the Region Capture API crops to an area of the current browser tab rather than capturing a specific element, any content drawn on top of the cropped area will be shown in the capture.

-Screen Capture API
-Using the Element Capture and Region Capture APIs

See also on MDN