Table of Contents

Class ImageCapture

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The ImageCapture interface of the MediaStream Image Capture API provides methods to enable the capture of images or photos from a camera or other photographic device. It provides an interface for capturing images from a photographic device referenced through a valid MediaStreamTrack.

[Value("ImageCapture")]
public class ImageCapture
Inheritance
ImageCapture
Inherited Members

Remarks

Constructors

ImageCapture()

public ImageCapture()

ImageCapture(MediaStreamTrack)

The ImageCapture() constructor
creates a new ImageCapture object.

public ImageCapture(MediaStreamTrack videoTrack)

Parameters

videoTrack MediaStreamTrack

Remarks

Properties

Track

The track read-only property of the
ImageCapture interface returns a reference to the
MediaStreamTrack passed to the
ImageCapture(MediaStreamTrack) constructor.

[Value("track")]
public MediaStreamTrack Track { get; }

Property Value

MediaStreamTrack

A MediaStreamTrack object.

Remarks

Methods

GetPhotoCapabilities()

The getPhotoCapabilities()
method of the ImageCapture interface returns a {{jsxref("Promise")}}
that resolves with an object containing the ranges of
available configuration options.

[Value("getPhotoCapabilities")]
public Task<PhotoCapabilities> GetPhotoCapabilities()

Returns

Task<PhotoCapabilities>

A Promise that resolves with an object containing the following properties:

Remarks

GetPhotoSettings()

The getPhotoSettings() method of
the ImageCapture interface returns a {{jsxref("Promise")}} that
resolves with an object containing the current photo
configuration settings.

[Value("getPhotoSettings")]
public Task<PhotoSettings> GetPhotoSettings()

Returns

Task<PhotoSettings>

A Promise that resolves with an object containing the following properties:

Remarks

GrabFrame()

The grabFrame() method of the
ImageCapture interface takes a snapshot of the live video in a
MediaStreamTrack and returns a {{jsxref("Promise")}} that resolves with
a ImageBitmap containing the snapshot.

[Value("grabFrame")]
public Task<ImageBitmap> GrabFrame()

Returns

Task<ImageBitmap>

A {{jsxref("Promise")}} that resolves to an ImageBitmap object.

Remarks

TakePhoto(PhotoSettings)

The takePhoto() method of the
ImageCapture interface takes a single exposure using the video capture
device sourcing a MediaStreamTrack and returns a {{jsxref("Promise")}}
that resolves with a Blob containing the data.

[Value("takePhoto")]
public Task<Blob> TakePhoto(PhotoSettings photoSettings = null)

Parameters

photoSettings PhotoSettings

Returns

Task<Blob>

A {{jsxref("Promise")}} that resolves with a Blob.

Remarks