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