Class RadWebCam
Represents a web cam control that displays the stream provided by a web cam.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Media.dll
Syntax
[TelerikToolboxCategory("Media")]
public class RadWebCam : Control, IThemable, IDisposable
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
System.Windows.DependencyProperty
|
CameraErrorContentProperty
Identifies the CameraErrorContent dependency property.
Declaration
public static readonly DependencyProperty CameraErrorContentProperty
Field Value
System.Windows.DependencyProperty
|
CameraErrorContentTemplateProperty
Identifies the CameraErrorContentTemplate dependency property.
Declaration
public static readonly DependencyProperty CameraErrorContentTemplateProperty
Field Value
System.Windows.DependencyProperty
|
CameraErrorEvent
Registers the CameraError routed event.
Declaration
public static readonly RoutedEvent CameraErrorEvent
Field Value
System.Windows.RoutedEvent
|
FlipHorizontallyProperty
Identifies the FlipHorizontally dependency property.
Declaration
public static readonly DependencyProperty FlipHorizontallyProperty
Field Value
System.Windows.DependencyProperty
|
FlipVerticallyProperty
Identifies the FlipVertically dependency property.
Declaration
public static readonly DependencyProperty FlipVerticallyProperty
Field Value
System.Windows.DependencyProperty
|
HasErrorProperty
Identifies the HasError dependency property.
Declaration
public static readonly DependencyProperty HasErrorProperty
Field Value
System.Windows.DependencyProperty
|
IsPreviewingSnapshotProperty
Identifies the IsPreviewingSnapshot dependency property.
Declaration
public static readonly DependencyProperty IsPreviewingSnapshotProperty
Field Value
System.Windows.DependencyProperty
|
IsRecordingProperty
Identifies the IsRecording dependency property.
Declaration
public static readonly DependencyProperty IsRecordingProperty
Field Value
System.Windows.DependencyProperty
|
PreviewSnapshotsProperty
Identifies the PreviewSnapshots dependency property.
Declaration
public static readonly DependencyProperty PreviewSnapshotsProperty
Field Value
System.Windows.DependencyProperty
|
RecordingButtonVisibilityProperty
Identifies the RecordingButtonVisibility dependency property.
Declaration
public static readonly DependencyProperty RecordingButtonVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
RecordingEndedEvent
Registers the RecordingEnded routed event.
Declaration
public static readonly RoutedEvent RecordingEndedEvent
Field Value
System.Windows.RoutedEvent
|
RecordingFilePathProperty
Identifies the RecordingFilePath dependency property.
Declaration
public static readonly DependencyProperty RecordingFilePathProperty
Field Value
System.Windows.DependencyProperty
|
RecordingLabelVisibilityProperty
Identifies the RecordingLabelVisibility dependency property.
Declaration
public static readonly DependencyProperty RecordingLabelVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
RecordingStartedEvent
Registers the RecordingStarted routed event.
Declaration
public static readonly RoutedEvent RecordingStartedEvent
Field Value
System.Windows.RoutedEvent
|
SettingsButtonVisibilityProperty
Identifies the SettingsButtonVisibility dependency property.
Declaration
public static readonly DependencyProperty SettingsButtonVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
ShowAudioSettingsProperty
Identifies the ShowAudioSettings dependency property.
Declaration
public static readonly DependencyProperty ShowAudioSettingsProperty
Field Value
System.Windows.DependencyProperty
|
SnapshotButtonVisibilityProperty
Identifies the SnapshotButtonVisibility dependency property.
Declaration
public static readonly DependencyProperty SnapshotButtonVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
SnapshotTakenEvent
Registers the SnapshotTaken routed event.
Declaration
public static readonly RoutedEvent SnapshotTakenEvent
Field Value
System.Windows.RoutedEvent
|
ToolbarPanelVisibilityProperty
Identifies the ToolbarPanelVisibility dependency property.
Declaration
public static readonly DependencyProperty ToolbarPanelVisibilityProperty
Field Value
System.Windows.DependencyProperty
|
VideoRecordingElapsedTimeFormatProperty
Identifies the VideoRecordingElapsedTimeFormat dependency property.
Declaration
public static readonly DependencyProperty VideoRecordingElapsedTimeFormatProperty
Field Value
System.Windows.DependencyProperty
|
VideoRecordingElapsedTimeTextProperty
Identifies the VideoRecordingElapsedTimeText dependency property.
Declaration
public static readonly DependencyProperty VideoRecordingElapsedTimeTextProperty
Field Value
System.Windows.DependencyProperty
|
Properties
AutoStart
Gets or sets whether the control will start the first webcam it finds upon starting the application.
Declaration
public bool AutoStart { get; set; }
Property Value
System.Boolean
|
CameraErrorContent
Gets a value indicating the content of the error message.
Declaration
public object CameraErrorContent { get; }
Property Value
System.Object
|
CameraErrorContentTemplate
Gets or sets the System.Windows.DataTemplate that defines the visual tree of the System.Windows.Controls.ContentPresenter instance that visualizes the CameraErrorContent property.
Declaration
public DataTemplate CameraErrorContentTemplate { get; set; }
Property Value
System.Windows.DataTemplate
|
FlipHorizontally
Gets or sets whether the control will flip the incoming video feed horizontally.
Declaration
public bool FlipHorizontally { get; set; }
Property Value
System.Boolean
|
FlipVertically
Gets or sets whether the control will flip the incoming video feed vertically.
Declaration
public bool FlipVertically { get; set; }
Property Value
System.Boolean
|
HasError
Gets a value indicating whether the camera is in an error state.
Declaration
public bool HasError { get; }
Property Value
System.Boolean
|
IsPreviewingSnapshot
Gets a value indicating whether the control is in snapshot preview mode.
Declaration
public bool IsPreviewingSnapshot { get; }
Property Value
System.Boolean
|
IsRecording
Gets or sets a value indicating whether the source content is being recorded to a file.
Declaration
public bool IsRecording { get; set; }
Property Value
System.Boolean
|
PreviewSnapshots
Gets or sets whether the control will go into preview mode when a snapshot is taken.
Declaration
public bool PreviewSnapshots { get; set; }
Property Value
System.Boolean
|
RecordingButtonVisibility
Gets or sets the visibility of the Toggle Recording button.
Declaration
public Visibility RecordingButtonVisibility { get; set; }
Property Value
System.Windows.Visibility
|
RecordingFilePath
Gets or sets the location where video files are stored when capturing.
Declaration
public string RecordingFilePath { get; set; }
Property Value
System.String
|
RecordingLabelVisibility
Gets or sets the visibility of the label displaying the elapsed time while recording.
Declaration
public Visibility RecordingLabelVisibility { get; set; }
Property Value
System.Windows.Visibility
|
SettingsButtonVisibility
Gets or sets the visibility of the Settings button.
Declaration
public Visibility SettingsButtonVisibility { get; set; }
Property Value
System.Windows.Visibility
|
ShowAudioSettings
Gets or sets whether the settings dialog will include an Audio tab for controlling mic settings.
Declaration
public bool ShowAudioSettings { get; set; }
Property Value
System.Boolean
|
SnapshotButtonVisibility
Gets or sets the visibility of the Take Snapshot button.
Declaration
public Visibility SnapshotButtonVisibility { get; set; }
Property Value
System.Windows.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
System.Windows.Visibility
|
VideoRecordingElapsedTimeFormat
Gets or sets the format of the elapsed time displayed during recording.
Declaration
public string VideoRecordingElapsedTimeFormat { get; set; }
Property Value
System.String
|
VideoRecordingElapsedTimeText
Gets or sets a value indicating for how long a video recording has been running.
Declaration
public string VideoRecordingElapsedTimeText { get; }
Property Value
System.String
|
Methods
add_CameraError(CameraErrorEventHandler)
Declaration
public void add_CameraError(CameraErrorEventHandler value)
Parameters
CameraErrorEventHandler
value
|
add_RecordingStarted(RecordingStartedEventHandler)
Declaration
public void add_RecordingStarted(RecordingStartedEventHandler value)
Parameters
RecordingStartedEventHandler
value
|
add_SnapshotTaken(SnapshotTakenEventHandler)
Declaration
public void add_SnapshotTaken(SnapshotTakenEventHandler value)
Parameters
SnapshotTakenEventHandler
value
|
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()
Dispose(Boolean)
Called when the control is destroyed.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
Finalize()
Releases unmanaged resources and performs other cleanup operations before the RadWebCam is reclaimed by garbage collection.
Declaration
protected override void Finalize()
GetAudioCaptureDevices()
Gets a list with all the available audio capture devices.
Declaration
public static ReadOnlyCollection<MediaFoundationDeviceInfo> GetAudioCaptureDevices()
Returns
System.Collections.ObjectModel.ReadOnlyCollection<MediaFoundationDeviceInfo>
|
GetVideoCaptureDevices()
Gets a list with all the available video capture devices.
Declaration
public static ReadOnlyCollection<MediaFoundationDeviceInfo> GetVideoCaptureDevices()
Returns
System.Collections.ObjectModel.ReadOnlyCollection<MediaFoundationDeviceInfo>
|
GetVideoFormats(MediaFoundationDeviceInfo, Boolean)
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
MediaFoundationDeviceInfo
device
The device for which to get the available formats. |
System.Boolean
recordingFormatsOnly
If set to true - only formats that allow saving to a video file will be returned. |
Returns
System.Collections.ObjectModel.ReadOnlyCollection<MediaFoundationVideoFormatInfo>
|
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
MediaFoundationDeviceInfo
videoDevice
|
MediaFoundationVideoFormatInfo
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
MediaFoundationDeviceInfo
videoDevice
|
MediaFoundationVideoFormatInfo
videoFormat
|
MediaFoundationDeviceInfo
audioDevice
|
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnCameraError(CameraErrorEventArgs)
Fires the CameraError event.
Declaration
protected virtual void OnCameraError(CameraErrorEventArgs e)
Parameters
CameraErrorEventArgs
e
The event arguments. |
OnCreateAutomationPeer()
Returns class-specific System.Windows.Automation.Peers.AutomationPeer.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer
The type-specific System.Windows.Automation.Peers.AutomationPeer implementation. |
OnInitialized(EventArgs)
Raises the System.Windows.FrameworkElement.Initialized event. This method is invoked whenever System.Windows.FrameworkElement.IsInitialized is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
System.EventArgs
e
The System.Windows.RoutedEventArgs that contains the event data. |
OnRecordingEnded(RadRoutedEventArgs)
Fires the RecordingEnded event.
Declaration
protected virtual void OnRecordingEnded(RadRoutedEventArgs e)
Parameters
RadRoutedEventArgs
e
The event arguments. |
OnRecordingStarted(RadRoutedEventArgs)
Fires the RecordingStarted event.
Declaration
protected virtual void OnRecordingStarted(RadRoutedEventArgs e)
Parameters
RadRoutedEventArgs
e
The event arguments. |
OnSnapshotTaken(SnapshotTakenEventArgs)
Fires the SnapshotTaken event.
Declaration
protected virtual void OnSnapshotTaken(SnapshotTakenEventArgs e)
Parameters
SnapshotTakenEventArgs
e
The event arguments. |
Pause()
Pauses the video pipeline and pauses displaying the video feed.
Declaration
public void Pause()
remove_CameraError(CameraErrorEventHandler)
Declaration
public void remove_CameraError(CameraErrorEventHandler value)
Parameters
CameraErrorEventHandler
value
|
remove_RecordingStarted(RecordingStartedEventHandler)
Declaration
public void remove_RecordingStarted(RecordingStartedEventHandler value)
Parameters
RecordingStartedEventHandler
value
|
remove_SnapshotTaken(SnapshotTakenEventHandler)
Declaration
public void remove_SnapshotTaken(SnapshotTakenEventHandler value)
Parameters
SnapshotTakenEventHandler
value
|
ResetTheme()
Resets the theme.
Declaration
public void ResetTheme()
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()
StopRecording()
Stops the file capture.
Declaration
public void StopRecording()
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 Type
CameraErrorEventHandler
|
RecordingEnded
Occurs when video recording has ended.
Declaration
public event RoutedEventHandler RecordingEnded
Event Type
System.Windows.RoutedEventHandler
|
RecordingStarted
Occurs when video recording is started.
Declaration
public event RecordingStartedEventHandler RecordingStarted
Event Type
RecordingStartedEventHandler
|
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 Type
SnapshotTakenEventHandler
|