RadWebCam
Represents a web cam control that displays the stream provided by a web cam.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.Media.dll
Syntax:
[TelerikToolboxCategory("Media")]
public class RadWebCam : Control, IDisposable
Inheritance: objectRadWebCam
Implements:
Constructors
Initializes a new instance of the RadWebCam class.
public RadWebCam()
Fields
AutoStartProperty
DependencyProperty
Identifies the AutoStart dependency property.
public static readonly DependencyProperty AutoStartProperty
CameraErrorContentProperty
DependencyProperty
Identifies the CameraErrorContent dependency property.
public static readonly DependencyProperty CameraErrorContentProperty
CameraErrorContentTemplateProperty
DependencyProperty
Identifies the CameraErrorContentTemplate dependency property.
public static readonly DependencyProperty CameraErrorContentTemplateProperty
CameraErrorEvent
RoutedEvent
Registers the CameraError routed event.
public static readonly RoutedEvent CameraErrorEvent
FlipHorizontallyProperty
DependencyProperty
Identifies the FlipHorizontally dependency property.
public static readonly DependencyProperty FlipHorizontallyProperty
FlipVerticallyProperty
DependencyProperty
Identifies the FlipVertically dependency property.
public static readonly DependencyProperty FlipVerticallyProperty
HasErrorProperty
DependencyProperty
Identifies the HasError dependency property.
public static readonly DependencyProperty HasErrorProperty
IsPreviewingSnapshotProperty
DependencyProperty
Identifies the IsPreviewingSnapshot dependency property.
public static readonly DependencyProperty IsPreviewingSnapshotProperty
IsRecordingProperty
DependencyProperty
Identifies the IsRecording dependency property.
public static readonly DependencyProperty IsRecordingProperty
PreviewSnapshotsProperty
DependencyProperty
Identifies the PreviewSnapshots dependency property.
public static readonly DependencyProperty PreviewSnapshotsProperty
RecordingButtonVisibilityProperty
DependencyProperty
Identifies the RecordingButtonVisibility dependency property.
public static readonly DependencyProperty RecordingButtonVisibilityProperty
RecordingEndedEvent
RoutedEvent
Registers the RecordingEnded routed event.
public static readonly RoutedEvent RecordingEndedEvent
RecordingFilePathProperty
DependencyProperty
Identifies the RecordingFilePath dependency property.
public static readonly DependencyProperty RecordingFilePathProperty
RecordingLabelVisibilityProperty
DependencyProperty
Identifies the RecordingLabelVisibility dependency property.
public static readonly DependencyProperty RecordingLabelVisibilityProperty
RecordingStartedEvent
RoutedEvent
Registers the RecordingStarted routed event.
public static readonly RoutedEvent RecordingStartedEvent
SettingsButtonVisibilityProperty
DependencyProperty
Identifies the SettingsButtonVisibility dependency property.
public static readonly DependencyProperty SettingsButtonVisibilityProperty
ShowAudioSettingsProperty
DependencyProperty
Identifies the ShowAudioSettings dependency property.
public static readonly DependencyProperty ShowAudioSettingsProperty
SnapshotButtonVisibilityProperty
DependencyProperty
Identifies the SnapshotButtonVisibility dependency property.
public static readonly DependencyProperty SnapshotButtonVisibilityProperty
SnapshotTakenEvent
RoutedEvent
Registers the SnapshotTaken routed event.
public static readonly RoutedEvent SnapshotTakenEvent
ToolbarPanelVisibilityProperty
DependencyProperty
Identifies the ToolbarPanelVisibility dependency property.
public static readonly DependencyProperty ToolbarPanelVisibilityProperty
VideoRecordingElapsedTimeFormatProperty
DependencyProperty
Identifies the VideoRecordingElapsedTimeFormat dependency property.
public static readonly DependencyProperty VideoRecordingElapsedTimeFormatProperty
VideoRecordingElapsedTimeTextProperty
DependencyProperty
Identifies the VideoRecordingElapsedTimeText dependency property.
public static readonly DependencyProperty VideoRecordingElapsedTimeTextProperty
Properties
Gets or sets whether the control will start the first webcam it finds upon starting the application.
public bool AutoStart { get; set; }
Gets a value indicating the content of the error message.
public object CameraErrorContent { get; }
CameraErrorContentTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual tree of the ContentPresenter instance that visualizes the property.
public DataTemplate CameraErrorContentTemplate { get; set; }
Gets or sets whether the control will flip the incoming video feed horizontally.
public bool FlipHorizontally { get; set; }
Gets or sets whether the control will flip the incoming video feed vertically.
public bool FlipVertically { get; set; }
Gets a value indicating whether the camera is in an error state.
public bool HasError { get; }
Gets a value indicating whether the control is in snapshot preview mode.
public bool IsPreviewingSnapshot { get; }
Gets or sets a value indicating whether the source content is being recorded to a file.
public bool IsRecording { get; set; }
Gets or sets whether the control will go into preview mode when a snapshot is taken.
public bool PreviewSnapshots { get; set; }
RecordingButtonVisibility
Visibility
Gets or sets the visibility of the Toggle Recording button.
public Visibility RecordingButtonVisibility { get; set; }
Gets or sets the location where video files are stored when capturing.
public string RecordingFilePath { get; set; }
RecordingLabelVisibility
Visibility
Gets or sets the visibility of the label displaying the elapsed time while recording.
public Visibility RecordingLabelVisibility { get; set; }
SettingsButtonVisibility
Visibility
Gets or sets the visibility of the Settings button.
public Visibility SettingsButtonVisibility { get; set; }
Gets or sets whether the settings dialog will include an Audio tab for controlling mic settings.
public bool ShowAudioSettings { get; set; }
SnapshotButtonVisibility
Visibility
Gets or sets the visibility of the Take Snapshot button.
public Visibility SnapshotButtonVisibility { get; set; }
ToolbarPanelVisibility
Visibility
Gets or sets the visibility of the Toolbar panel that hosts all the camera built-in controls.
public Visibility ToolbarPanelVisibility { get; set; }
Gets or sets the format of the elapsed time displayed during recording.
public string VideoRecordingElapsedTimeFormat { get; set; }
Gets or sets a value indicating for how long a video recording has been running.
public string VideoRecordingElapsedTimeText { get; }
Methods
Discards the snapshot that is currently being previewed. PreviewSnapshots must be set to true and the control must be previewing a snapshot triggered by calling TakeSnapshot().
public void DiscardSnapshot()
Called when the control is destroyed.
public void Dispose()
Implements:
Called when the control is destroyed.
Releases unmanaged resources and performs other cleanup operations before the RadWebCam is reclaimed by garbage collection.
protected override void Finalize()
Gets a list with all the available audio capture devices.
public static ReadOnlyCollection<MediaFoundationDeviceInfo> GetAudioCaptureDevices()
Gets a list with all the available video capture devices.
public static ReadOnlyCollection<MediaFoundationDeviceInfo> GetVideoCaptureDevices()
Gets a list with all the available video file formats for the provided device.
public static ReadOnlyCollection<MediaFoundationVideoFormatInfo> GetVideoFormats(MediaFoundationDeviceInfo device, bool recordingFormatsOnly = false)
The device for which to get the available formats.
recordingFormatsOnlyboolIf set to true - only formats that allow saving to a video file will be returned.
Returns:Starts up the video pipeline and displays the video from the source inside of the control.
The device to use as a video source. The format from the video source. The device to use as a audio source.public void Initialize(MediaFoundationDeviceInfo videoDevice, MediaFoundationVideoFormatInfo videoFormat, MediaFoundationDeviceInfo audioDevice)
Starts up the video pipeline and displays the video from the source inside of the control.
The device to use as a video source. The format from the video source.public void Initialize(MediaFoundationDeviceInfo videoDevice, MediaFoundationVideoFormatInfo videoFormat)
When overridden in a derived class, is invoked whenever application code or internal processes call .
public override void OnApplyTemplate()
Fires the CameraError event.
protected virtual void OnCameraError(CameraErrorEventArgs e)
The event arguments.
OnCreateAutomationPeer()
AutomationPeer
Returns class-specific AutomationPeer.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
The type-specific AutomationPeer implementation.
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Fires the RecordingEnded event.
protected virtual void OnRecordingEnded(RadRoutedEventArgs e)
The event arguments.
Fires the RecordingStarted event.
protected virtual void OnRecordingStarted(RadRoutedEventArgs e)
The event arguments.
Fires the SnapshotTaken event.
protected virtual void OnSnapshotTaken(SnapshotTakenEventArgs e)
The event arguments.
Pauses the video pipeline and pauses displaying the video feed.
public void Pause()
Resets the theme.
public void ResetTheme()
Saves the snapshot that is currently being previewed. PreviewSnapshots must be set to true and the control must be previewing a snapshot triggered by calling TakeSnapshot().
public void SaveSnapshot()
Shuts down the media session and the recording.
public void ShutDown()
Starts the video pipeline and starts displaying the video feed.
public void Start()
Starts capturing the media source(s) to a file. The RecordingFilePath property must be set before calling this method.
public void StartRecording()
Stops the video pipeline and stops displaying the video feed.
public void Stop()
Stops the file capture.
public void StopRecording()
Takes a snapshot from the currently displayed video feed. To get the snapshot subscribe to the SnapshotTaken event.
public void TakeSnapshot()
Events
Occurs when an error is preventing the camera from operating normally.
public event CameraErrorEventHandler CameraError
RecordingEnded
RoutedEventHandler
Occurs when video recording has ended.
public event RoutedEventHandler RecordingEnded
Occurs when video recording is started.
public event RecordingStartedEventHandler RecordingStarted
Occurs when a snapshot is taken. If PreviewSnapshots is set to true the event is fired only if the SaveSnapshot command is executed.
public event SnapshotTakenEventHandler SnapshotTaken