ImageCapture Class
Takes photos and grabs frames of a video track (https://w3c.github.io/mediacapture-image/#imagecaptureapi). The photos are the current frame of the track, encoded as PNG at the size of the track: the capture backend has no photo mode.
public sealed class ImageCaptureConstructors
| Name | Description |
|---|---|
| ImageCapture(MediaStreamTrack) | Creates the image capture of a video track. |
ImageCapture(MediaStreamTrack)
ImageCapture.csCreates the image capture of a video track.
public ImageCapture(MediaStreamTrack videoTrack)Parameters
videoTrackMediaStreamTrack- The video track.
Exceptions
DomException- A
NotSupportedError: the track is not a video track.
See also
Properties
| Name | Description |
|---|---|
| Track | Gets the video track. |
Track
ImageCapture.csMethods
| Name | Description |
|---|---|
| GetPhotoCapabilities() | Returns the capabilities of the photos: their size is the size of the track (https://w3c.github.io/mediacapture-image/#dom-imagecapture-getphotocapabilities). |
| GetPhotoSettings() | Returns the settings of the photos (https://w3c.github.io/mediacapture-image/#dom-imagecapture-getphotosettings). |
| GrabFrame() | Grabs the current frame of the track (https://w3c.github.io/mediacapture-image/#dom-imagecapture-grabframe). The task fails with an InvalidStateError when the track is not live, is disabled or is muted, and with an UnknownError when the track has no frame. |
| TakePhoto(PhotoSettings?) | Takes a photo (https://w3c.github.io/mediacapture-image/#dom-imagecapture-takephoto): the current frame of the track, as a PNG image. The task fails with an InvalidStateError when the track is not live, with an OverconstrainedError when the settings are not in the photo capabilities (the size of the photos is the size of the track, there is no flash and no red-eye reduction), and with an UnknownError when the track has no frame. |
GetPhotoCapabilities()
ImageCapture.csReturns the capabilities of the photos: their size is the size of the track (https://w3c.github.io/mediacapture-image/#dom-imagecapture-getphotocapabilities).
public Task<PhotoCapabilities> GetPhotoCapabilities()GetPhotoSettings()
ImageCapture.csReturns the settings of the photos (https://w3c.github.io/mediacapture-image/#dom-imagecapture-getphotosettings).
public Task<PhotoSettings> GetPhotoSettings()GrabFrame()
ImageCapture.csGrabs the current frame of the track (https://w3c.github.io/mediacapture-image/#dom-imagecapture-grabframe). The task fails with an InvalidStateError when the track is not live, is disabled or is muted, and with an UnknownError when the track has no frame.
public Task<ImageBitmap> GrabFrame()TakePhoto(PhotoSettings?)
ImageCapture.csTakes a photo (https://w3c.github.io/mediacapture-image/#dom-imagecapture-takephoto): the current frame of the track, as a PNG image. The task fails with an InvalidStateError when the track is not live, with an OverconstrainedError when the settings are not in the photo capabilities (the size of the photos is the size of the track, there is no flash and no red-eye reduction), and with an UnknownError when the track has no frame.
public Task<Blob> TakePhoto(PhotoSettings? photoSettings = null)