New to Telerik UI for WPFStart a free 30-day trial

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:

C#
[TelerikToolboxCategory("Media")]
public class RadWebCam : Control, IDisposable

Inheritance: objectRadWebCam

Implements: IDisposable

Constructors

Initializes a new instance of the RadWebCam class.

C#
public RadWebCam()

Fields

AutoStartProperty

DependencyProperty

Identifies the AutoStart dependency property.

C#
public static readonly DependencyProperty AutoStartProperty

CameraErrorContentProperty

DependencyProperty

Identifies the CameraErrorContent dependency property.

C#
public static readonly DependencyProperty CameraErrorContentProperty

Identifies the CameraErrorContentTemplate dependency property.

C#
public static readonly DependencyProperty CameraErrorContentTemplateProperty

CameraErrorEvent

RoutedEvent

Registers the CameraError routed event.

C#
public static readonly RoutedEvent CameraErrorEvent

FlipHorizontallyProperty

DependencyProperty

Identifies the FlipHorizontally dependency property.

C#
public static readonly DependencyProperty FlipHorizontallyProperty

FlipVerticallyProperty

DependencyProperty

Identifies the FlipVertically dependency property.

C#
public static readonly DependencyProperty FlipVerticallyProperty

HasErrorProperty

DependencyProperty

Identifies the HasError dependency property.

C#
public static readonly DependencyProperty HasErrorProperty

Identifies the IsPreviewingSnapshot dependency property.

C#
public static readonly DependencyProperty IsPreviewingSnapshotProperty

IsRecordingProperty

DependencyProperty

Identifies the IsRecording dependency property.

C#
public static readonly DependencyProperty IsRecordingProperty

PreviewSnapshotsProperty

DependencyProperty

Identifies the PreviewSnapshots dependency property.

C#
public static readonly DependencyProperty PreviewSnapshotsProperty

Identifies the RecordingButtonVisibility dependency property.

C#
public static readonly DependencyProperty RecordingButtonVisibilityProperty

Registers the RecordingEnded routed event.

C#
public static readonly RoutedEvent RecordingEndedEvent

RecordingFilePathProperty

DependencyProperty

Identifies the RecordingFilePath dependency property.

C#
public static readonly DependencyProperty RecordingFilePathProperty

Identifies the RecordingLabelVisibility dependency property.

C#
public static readonly DependencyProperty RecordingLabelVisibilityProperty

Registers the RecordingStarted routed event.

C#
public static readonly RoutedEvent RecordingStartedEvent

Identifies the SettingsButtonVisibility dependency property.

C#
public static readonly DependencyProperty SettingsButtonVisibilityProperty

ShowAudioSettingsProperty

DependencyProperty

Identifies the ShowAudioSettings dependency property.

C#
public static readonly DependencyProperty ShowAudioSettingsProperty

Identifies the SnapshotButtonVisibility dependency property.

C#
public static readonly DependencyProperty SnapshotButtonVisibilityProperty

Registers the SnapshotTaken routed event.

C#
public static readonly RoutedEvent SnapshotTakenEvent

Identifies the ToolbarPanelVisibility dependency property.

C#
public static readonly DependencyProperty ToolbarPanelVisibilityProperty

Identifies the VideoRecordingElapsedTimeFormat dependency property.

C#
public static readonly DependencyProperty VideoRecordingElapsedTimeFormatProperty

Identifies the VideoRecordingElapsedTimeText dependency property.

C#
public static readonly DependencyProperty VideoRecordingElapsedTimeTextProperty

Properties

Gets or sets whether the control will start the first webcam it finds upon starting the application.

C#
public bool AutoStart { get; set; }

Gets a value indicating the content of the error message.

C#
public object CameraErrorContent { get; }

Gets or sets the DataTemplate that defines the visual tree of the ContentPresenter instance that visualizes the property.

C#
public DataTemplate CameraErrorContentTemplate { get; set; }

Gets or sets whether the control will flip the incoming video feed horizontally.

C#
public bool FlipHorizontally { get; set; }

Gets or sets whether the control will flip the incoming video feed vertically.

C#
public bool FlipVertically { get; set; }

Gets a value indicating whether the camera is in an error state.

C#
public bool HasError { get; }

Gets a value indicating whether the control is in snapshot preview mode.

C#
public bool IsPreviewingSnapshot { get; }

Gets or sets a value indicating whether the source content is being recorded to a file.

C#
public bool IsRecording { get; set; }

Gets or sets whether the control will go into preview mode when a snapshot is taken.

C#
public bool PreviewSnapshots { get; set; }

Gets or sets the visibility of the Toggle Recording button.

C#
public Visibility RecordingButtonVisibility { get; set; }

Gets or sets the location where video files are stored when capturing.

C#
public string RecordingFilePath { get; set; }

Gets or sets the visibility of the label displaying the elapsed time while recording.

C#
public Visibility RecordingLabelVisibility { get; set; }

Gets or sets the visibility of the Settings button.

C#
public Visibility SettingsButtonVisibility { get; set; }

Gets or sets whether the settings dialog will include an Audio tab for controlling mic settings.

C#
public bool ShowAudioSettings { get; set; }

Gets or sets the visibility of the Take Snapshot button.

C#
public Visibility SnapshotButtonVisibility { get; set; }

Gets or sets the visibility of the Toolbar panel that hosts all the camera built-in controls.

C#
public Visibility ToolbarPanelVisibility { get; set; }

Gets or sets the format of the elapsed time displayed during recording.

C#
public string VideoRecordingElapsedTimeFormat { get; set; }

Gets or sets a value indicating for how long a video recording has been running.

C#
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().

C#
public void DiscardSnapshot()

Called when the control is destroyed.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Called when the control is destroyed.

C#
protected virtual void Dispose(bool disposing)
Parameters:disposingbool

Releases unmanaged resources and performs other cleanup operations before the RadWebCam is reclaimed by garbage collection.

C#
protected override void Finalize()

Gets a list with all the available audio capture devices.

C#
public static ReadOnlyCollection<MediaFoundationDeviceInfo> GetAudioCaptureDevices()
Returns:

ReadOnlyCollection<MediaFoundationDeviceInfo>

Gets a list with all the available video capture devices.

C#
public static ReadOnlyCollection<MediaFoundationDeviceInfo> GetVideoCaptureDevices()
Returns:

ReadOnlyCollection<MediaFoundationDeviceInfo>

Gets a list with all the available video file formats for the provided device.

C#
public static ReadOnlyCollection<MediaFoundationVideoFormatInfo> GetVideoFormats(MediaFoundationDeviceInfo device, bool recordingFormatsOnly = false)
Parameters:deviceMediaFoundationDeviceInfo

The device for which to get the available formats.

recordingFormatsOnlybool

If set to true - only formats that allow saving to a video file will be returned.

Returns:

ReadOnlyCollection<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. The device to use as a audio source.
C#
public void Initialize(MediaFoundationDeviceInfo videoDevice, MediaFoundationVideoFormatInfo videoFormat, MediaFoundationDeviceInfo audioDevice)
Parameters:videoDeviceMediaFoundationDeviceInfovideoFormatMediaFoundationVideoFormatInfoaudioDeviceMediaFoundationDeviceInfo

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.
C#
public void Initialize(MediaFoundationDeviceInfo videoDevice, MediaFoundationVideoFormatInfo videoFormat)
Parameters:videoDeviceMediaFoundationDeviceInfovideoFormatMediaFoundationVideoFormatInfo

When overridden in a derived class, is invoked whenever application code or internal processes call .

C#
public override void OnApplyTemplate()

Fires the CameraError event.

C#
protected virtual void OnCameraError(CameraErrorEventArgs e)
Parameters:eCameraErrorEventArgs

The event arguments.

Returns class-specific AutomationPeer.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

The type-specific AutomationPeer implementation.

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

Fires the RecordingEnded event.

C#
protected virtual void OnRecordingEnded(RadRoutedEventArgs e)
Parameters:eRadRoutedEventArgs

The event arguments.

Fires the RecordingStarted event.

C#
protected virtual void OnRecordingStarted(RadRoutedEventArgs e)
Parameters:eRadRoutedEventArgs

The event arguments.

Fires the SnapshotTaken event.

C#
protected virtual void OnSnapshotTaken(SnapshotTakenEventArgs e)
Parameters:eSnapshotTakenEventArgs

The event arguments.

Pauses the video pipeline and pauses displaying the video feed.

C#
public void Pause()

Resets the theme.

C#
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().

C#
public void SaveSnapshot()

Shuts down the media session and the recording.

C#
public void ShutDown()

Starts the video pipeline and starts displaying the video feed.

C#
public void Start()

Starts capturing the media source(s) to a file. The RecordingFilePath property must be set before calling this method.

C#
public void StartRecording()

Stops the video pipeline and stops displaying the video feed.

C#
public void Stop()

Stops the file capture.

C#
public void StopRecording()

Takes a snapshot from the currently displayed video feed. To get the snapshot subscribe to the SnapshotTaken event.

C#
public void TakeSnapshot()

Events

Occurs when an error is preventing the camera from operating normally.

C#
public event CameraErrorEventHandler CameraError

RecordingEnded

RoutedEventHandler

Occurs when video recording has ended.

C#
public event RoutedEventHandler RecordingEnded

Occurs when video recording is started.

C#
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.

C#
public event SnapshotTakenEventHandler SnapshotTaken
In this article
DefinitionConstructorsRadWebCam()FieldsAutoStartPropertyCameraErrorContentPropertyCameraErrorContentTemplatePropertyCameraErrorEventFlipHorizontallyPropertyFlipVerticallyPropertyHasErrorPropertyIsPreviewingSnapshotPropertyIsRecordingPropertyPreviewSnapshotsPropertyRecordingButtonVisibilityPropertyRecordingEndedEventRecordingFilePathPropertyRecordingLabelVisibilityPropertyRecordingStartedEventSettingsButtonVisibilityPropertyShowAudioSettingsPropertySnapshotButtonVisibilityPropertySnapshotTakenEventToolbarPanelVisibilityPropertyVideoRecordingElapsedTimeFormatPropertyVideoRecordingElapsedTimeTextPropertyPropertiesAutoStartCameraErrorContentCameraErrorContentTemplateFlipHorizontallyFlipVerticallyHasErrorIsPreviewingSnapshotIsRecordingPreviewSnapshotsRecordingButtonVisibilityRecordingFilePathRecordingLabelVisibilitySettingsButtonVisibilityShowAudioSettingsSnapshotButtonVisibilityToolbarPanelVisibilityVideoRecordingElapsedTimeFormatVideoRecordingElapsedTimeTextMethodsDiscardSnapshot()Dispose()Dispose(bool)Finalize()GetAudioCaptureDevices()GetVideoCaptureDevices()GetVideoFormats(MediaFoundationDeviceInfo, bool)Initialize(MediaFoundationDeviceInfo, MediaFoundationVideoFormatInfo, MediaFoundationDeviceInfo)Initialize(MediaFoundationDeviceInfo, MediaFoundationVideoFormatInfo)OnApplyTemplate()OnCameraError(CameraErrorEventArgs)OnCreateAutomationPeer()OnInitialized(EventArgs)OnRecordingEnded(RadRoutedEventArgs)OnRecordingStarted(RadRoutedEventArgs)OnSnapshotTaken(SnapshotTakenEventArgs)Pause()ResetTheme()SaveSnapshot()ShutDown()Start()StartRecording()Stop()StopRecording()TakeSnapshot()EventsCameraErrorRecordingEndedRecordingStartedSnapshotTaken
Not finding the help you need?
Contact Support