Class RadWebCam
Represents a web cam control that displays the stream provided by a web cam.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.RadWebCam.dll
Syntax
[TelerikToolboxCategory("Data Controls")]
public class RadWebCam : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider, IMediaFoundationRenderSurface
Constructors
RadWebCam()
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
|
CameraBorderElement
Gets the element representing the border of the camera.
Declaration
public LightVisualElement CameraBorderElement { get; }
Property Value
LightVisualElement
|
ControlPanelHeight
Gets or sets the height of the panel with the camera controls.
Declaration
public int ControlPanelHeight { get; set; }
Property Value
System.Int32
|
DefaultSize
Gets the default size of the control.
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
|
HasError
Gets a value indicating whether the camera is in a state where something is preventing normal operation.
Declaration
public bool HasError { get; protected set; }
Property Value
System.Boolean
|
IsPreviewingSnapshot
Gets or sets a value indicating whether the control is in snapshot preview mode.
Declaration
public bool IsPreviewingSnapshot { get; set; }
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
|
RecordingFilePath
Gets or sets the location where video files are stored when capturing.
Declaration
public string RecordingFilePath { get; set; }
Property Value
System.String
|
SnapshotPreviewElement
Gets the snapshot preview element.
Declaration
public LightVisualElement SnapshotPreviewElement { get; }
Property Value
LightVisualElement
|
VideoRecordingElapsedTimeFormat
Gets or sets the format of the elapsed time displayed during recording.
Declaration
public string VideoRecordingElapsedTimeFormat { get; set; }
Property Value
System.String
|
WebCamElement
Gets the main web cam control element.
Declaration
public RadWebCamElement WebCamElement { get; }
Property Value
RadWebCamElement
|
Methods
CreateCameraBorderElement()
Creates the camera border element.
Declaration
protected virtual LightVisualElement CreateCameraBorderElement()
Returns
LightVisualElement
|
CreateChildItems(RadElement)
Creates the child elements of the control.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
RadElement
parent
The root element of the control's element tree. |
Overrides
CreateRootElement()
Creates the root RadElement of the control.
Declaration
protected override RootRadElement CreateRootElement()
Returns
RootRadElement
|
Overrides
CreateSnapshotPreviewElement()
Creates the snapshot preview element.
Declaration
protected virtual LightVisualElement CreateSnapshotPreviewElement()
Returns
LightVisualElement
|
CreateWebCamElement()
Creates the main RadWebCam element.
Declaration
protected virtual RadWebCamElement CreateWebCamElement()
Returns
RadWebCamElement
|
CreateWebCamRootElement()
Creates the root element of RadWebCam.
Declaration
protected virtual WebCamRootRadElement CreateWebCamRootElement()
Returns
WebCamRootRadElement
|
DiscardSnapshot()
Discards the taken snapshot when the control is in preview snapshot mode.
Declaration
public virtual void DiscardSnapshot()
Dispose(Boolean)
Releases the unmanaged resources used by the System.Windows.Forms.Control and its child controls and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
Overrides
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 virtual 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 virtual void Initialize(MediaFoundationDeviceInfo videoDevice, MediaFoundationVideoFormatInfo videoFormat, MediaFoundationDeviceInfo audioDevice)
Parameters
MediaFoundationDeviceInfo
videoDevice
|
MediaFoundationVideoFormatInfo
videoFormat
|
MediaFoundationDeviceInfo
audioDevice
|
OnCameraError(CameraErrorEventArgs)
Fires the CameraError event.
Declaration
protected virtual void OnCameraError(CameraErrorEventArgs e)
Parameters
CameraErrorEventArgs
e
The event arguments. |
OnHandleCreated(EventArgs)
Raises the System.Windows.Forms.Control.HandleCreated event.
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
OnLoad(Size)
Notifies that the control is about to be visualized.
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
System.Drawing.Size
desiredSize
|
Overrides
OnRecordingEnded(EventArgs)
Fires the RecordingEnded event.
Declaration
protected virtual void OnRecordingEnded(EventArgs e)
Parameters
System.EventArgs
e
The event arguments. |
OnRecordingStarted(CancelEventArgs)
Fires the RecordingStarted event.
Declaration
protected virtual void OnRecordingStarted(CancelEventArgs e)
Parameters
System.ComponentModel.CancelEventArgs
e
The event arguments. |
OnSettingsDialogShowing(CameraSettingsDialogShowingEventArgs)
Fires the SettingsDialogShowing event.
Declaration
protected virtual void OnSettingsDialogShowing(CameraSettingsDialogShowingEventArgs e)
Parameters
CameraSettingsDialogShowingEventArgs
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 virtual void Pause()
SaveSnapshot()
Triggers the SnapshotTaken event when the control is in preview snapshot mode.
Declaration
public virtual void SaveSnapshot()
SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)
Performs the work of setting the specified bounds of this control.
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
System.Int32
x
|
System.Int32
y
|
System.Int32
width
|
System.Int32
height
|
System.Windows.Forms.BoundsSpecified
specified
|
Overrides
ShowSettingsDialog()
Shows the camera settings dialog.
Declaration
public virtual void ShowSettingsDialog()
ShutDown()
Shuts down the video pipeline.
Declaration
public virtual void ShutDown()
Start()
Starts the video pipeline and starts displaying the video feed.
Declaration
public virtual void Start()
StartRecording()
Starts capturing the media source(s) to a file. The RecordingFilePath property must be set before calling this method.
Declaration
public virtual void StartRecording()
Stop()
Stops the video pipeline and stops displaying the video feed.
Declaration
public virtual void Stop()
StopRecording()
Stops the file capture.
Declaration
public virtual void StopRecording()
TakeSnapshot()
Takes a snapshot from the currently displayed video feed. To get the snapshot subscribe to the SnapshotTaken event.
Declaration
public virtual void TakeSnapshot()
Events
CameraError
Occurs when an error is preventing the camera from operating normally.
Declaration
public event EventHandler<CameraErrorEventArgs> CameraError
Event Type
System.EventHandler<CameraErrorEventArgs>
|
RecordingEnded
Occurs when video recording has ended.
Declaration
public event EventHandler RecordingEnded
Event Type
System.EventHandler
|
RecordingStarted
Occurs when video recording is started.
Declaration
public event EventHandler<CancelEventArgs> RecordingStarted
Event Type
System.EventHandler<System.ComponentModel.CancelEventArgs>
|
SettingsDialogShowing
Occurs when the settings dialog is about to be shown.
Declaration
public event EventHandler<CameraSettingsDialogShowingEventArgs> SettingsDialogShowing
Event Type
System.EventHandler<CameraSettingsDialogShowingEventArgs>
|
SnapshotTaken
Occurs when a snapshot is taken. If PreviewSnapshots is set to true the event is fired only if the SaveSnapshot button is pressed.
Declaration
public event EventHandler<SnapshotTakenEventArgs> SnapshotTaken
Event Type
System.EventHandler<SnapshotTakenEventArgs>
|
Explicit Interface Implementations
IMediaFoundationRenderSurface.GetHandle()
Declaration
IntPtr IMediaFoundationRenderSurface.GetHandle()
Returns
System.IntPtr
|