Class
RadWebCam

Represents a web cam control that displays the stream provided by a web cam.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadWebCam.dll

Syntax:

cs-api-definition
[TelerikToolboxCategory("Data Controls")]
public class RadWebCam : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IMediaFoundationRenderSurface

Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadWebCam

Implements: IAnalyticsProviderIBindableComponentIComponentIComponentTreeHandlerIDisposableIDropTargetILayoutHandlerIMediaFoundationRenderSurfaceINotifyPropertyChangedISupportInitializeISupportInitializeNotificationISynchronizeInvokeIWin32Window

Inherited Members RadControl.isResizing2RadControl.isDisposing2RadControl.invalidResizeRectRadControl.isAccessibilityRequestedRadControl.Construct()RadControl.CreateBehavior()RadControl.InitializeRootElement(RootRadElement)RadControl.LoadElementTree()RadControl.LoadElementTree(Size)RadControl.SetBackColorThemeOverrides()RadControl.ResetBackColorThemeOverrides()RadControl.SetForeColorThemeOverrides()RadControl.ResetForeColorThemeOverrides()RadControl.OnKeyDown(KeyEventArgs)RadControl.OnKeyUp(KeyEventArgs)RadControl.OnPreviewKeyDown(PreviewKeyDownEventArgs)RadControl.OnKeyPress(KeyPressEventArgs)RadControl.OnClick(EventArgs)RadControl.OnDoubleClick(EventArgs)RadControl.OnMouseDown(MouseEventArgs)RadControl.OnMouseUp(MouseEventArgs)RadControl.OnMouseEnter(EventArgs)RadControl.OnMouseLeave(EventArgs)RadControl.OnMouseMove(MouseEventArgs)RadControl.OnMouseHover(EventArgs)RadControl.OnMouseWheel(MouseEventArgs)RadControl.OnMouseCaptureChanged(EventArgs)RadControl.OnGotFocus(EventArgs)RadControl.OnLostFocus(EventArgs)RadControl.OnCreateControl()RadControl.OnHandleDestroyed(EventArgs)RadControl.OnParentChanged(EventArgs)RadControl.OnVisibleChanged(EventArgs)RadControl.OnFontChanged(EventArgs)RadControl.OnForeColorChanged(EventArgs)RadControl.OnBackColorChanged(EventArgs)RadControl.OnEnabledChanged(EventArgs)RadControl.OnBindingContextChanged(EventArgs)RadControl.OnLocationChanged(EventArgs)RadControl.OnPaddingChanged(EventArgs)RadControl.OnRightToLeftChanged(EventArgs)RadControl.OnPaint(PaintEventArgs)RadControl.OnLayout(LayoutEventArgs)RadControl.OnAutoSizeChanged(EventArgs)RadControl.WndProc(ref Message)RadControl.OnInvalidated(RadElement)RadControl.OnCaptureLosing()RadControl.OnThemeChanged()RadControl.OnToolTipTextNeeded(object, ToolTipTextNeededEventArgs)RadControl.OnScreenTipNeeded(object, ScreenTipNeededEventArgs)RadControl.OnThemeNameChanged(ThemeNameChangedEventArgs)RadControl.ProcessMnemonic(char)RadControl.ProcessFocusRequested(RadElement)RadControl.ProcessCaptureChangeRequested(RadElement, bool)RadControl.ProcessAutoSizeChanged(bool)RadControl.IsInputKey(Keys)RadControl.GetInputElement()RadControl.BeginInit()RadControl.EndInit()RadControl.OnNotifyPropertyChanged(string)RadControl.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadControl.GetPreferredSize(Size)RadControl.GetRootElementDesiredSize(int, int, int, int)RadControl.OnZoomGesture(ZoomGestureEventArgs)RadControl.OnRotateGesture(RotateGestureEventArgs)RadControl.OnPanGesture(PanGestureEventArgs)RadControl.OnTwoFingerTapGesture(GestureEventArgs)RadControl.OnPressAndTapGesture(PressAndTapGestureEventArgs)RadControl.OnGesture(GestureEventArgs)RadControl.ProcessGesture(Message)RadControl.EnableGesture(GestureType)RadControl.DisableGesture(GestureType)RadControl.Refresh()RadControl.SuspendUpdate()RadControl.ResumeUpdate()RadControl.ResumeUpdate(bool)RadControl.InvokeLayoutCallback(LayoutCallback)RadControl.RegisterHostedControl(RadHostItem)RadControl.UnregisterHostedControl(RadHostItem, bool)RadControl.ResolveStyleGroupForElement(StyleGroup, RadObject)RadControl.GetPlainText()RadControl.ShouldSerializeProperty(RadProperty)RadControl.ShouldSerializeProperty(RadProperty, RadObject)RadControl.ResetProperty(RadProperty, RadObject)RadControl.CanEditElementAtDesignTime(RadElement)RadControl.ProcessCodedUIMessage(ref IPCMessage)RadControl.FindPropertyInChildren(RadControl, IPCMessage)RadControl.ScaleControl(SizeF, BoundsSpecified)RadControl.PerformRadAutoScale(BoundsSpecified?)RadControl.GetMonitorDpiScaleFactor(Control)RadControl.SetRadAutoScale(bool)RadControl.EnableDpiScalingRadControl.EnableRadAutoScaleRadControl.EnableRadFormInitialDpiScalingRadControl.EnableImageDpiScalingRadControl.EnableSvgImagesRadControl.IsLoadedRadControl.ElementTreeRadControl.UseCompatibleTextRenderingDefaultValueRadControl.BehaviorRadControl.RootElementRadControl.PaddingRadControl.ThemeNameRadControl.TextRadControl.EnableThemingRadControl.ThemeClassNameRadControl.ImageListRadControl.ImageScalingSizeRadControl.UseCompatibleTextRenderingRadControl.AutoSizeRadControl.MaximumSizeRadControl.MinimumSizeRadControl.FocusableRadControl.SiteRadControl.CausesValidationRadControl.IsInitializingRadControl.SmallImageListRadControl.SmallImageScalingSizeRadControl.IsDesignModeRadControl.IsDisplayedRadControl.FocusedElementRadControl.AllowShowFocusCuesRadControl.ShowItemToolTipsRadControl.CommandBindingsRadControl.EnableKeyMapRadControl.BackColorRadControl.ForeColorRadControl.FontRadControl.ValidationCancelRadControl.EnableAnalyticsRadControl.AnalyticsNameRadControl.EnableRadAccessibilityObjectsRadControl.EnableCodedUITestsRadControl.EnableCodedUITestsDefaultValueRadControl.EnableUIAutomationRadControl.EnableUIAutomationDefaultValueRadControl.ElementInvalidatedRadControl.ToolTipTextNeededRadControl.ScreenTipNeededRadControl.ThemeNameChangedRadControl.InitializedRadControl.PropertyChangedRadControl.ZoomGestureRadControl.RotateGestureRadControl.PanGestureRadControl.TwoFingerTapGestureRadControl.PressAndTapGestureScrollableControl.ScrollStateAutoScrollingScrollableControl.ScrollStateHScrollVisibleScrollableControl.ScrollStateVScrollVisibleScrollableControl.ScrollStateUserHasScrolledScrollableControl.ScrollStateFullDragScrollableControl.AdjustFormScrollbars(bool)ScrollableControl.GetScrollState(int)ScrollableControl.OnPaintBackground(PaintEventArgs)ScrollableControl.SetDisplayRectLocation(int, int)ScrollableControl.ScrollControlIntoView(Control)ScrollableControl.ScrollToControl(Control)ScrollableControl.OnScroll(ScrollEventArgs)ScrollableControl.SetAutoScrollMargin(int, int)ScrollableControl.SetScrollState(int, bool)ScrollableControl.AutoScrollScrollableControl.AutoScrollMarginScrollableControl.AutoScrollPositionScrollableControl.AutoScrollMinSizeScrollableControl.CreateParamsScrollableControl.DisplayRectangleScrollableControl.HScrollScrollableControl.HorizontalScrollScrollableControl.VScrollScrollableControl.VerticalScrollScrollableControl.ScrollControl.GetAccessibilityObjectById(int)Control.SetAutoSizeMode(AutoSizeMode)Control.GetAutoSizeMode()Control.AccessibilityNotifyClients(AccessibleEvents, int)Control.AccessibilityNotifyClients(AccessibleEvents, int, int)Control.BeginInvoke(Delegate)Control.BeginInvoke(Delegate, params object[])Control.BringToFront()Control.Contains(Control)Control.CreateAccessibilityInstance()Control.CreateControlsInstance()Control.CreateGraphics()Control.CreateHandle()Control.CreateControl()Control.DefWndProc(ref Message)Control.DestroyHandle()Control.DoDragDrop(object, DragDropEffects)Control.DrawToBitmap(Bitmap, Rectangle)Control.EndInvoke(IAsyncResult)Control.FindForm()Control.GetTopLevel()Control.RaiseKeyEvent(object, KeyEventArgs)Control.RaiseMouseEvent(object, MouseEventArgs)Control.Focus()Control.FromChildHandle(IntPtr)Control.FromHandle(IntPtr)Control.GetChildAtPoint(Point, GetChildAtPointSkip)Control.GetChildAtPoint(Point)Control.GetContainerControl()Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified)Control.GetNextControl(Control, bool)Control.GetStyle(ControlStyles)Control.Hide()Control.InitLayout()Control.Invalidate(Region)Control.Invalidate(Region, bool)Control.Invalidate()Control.Invalidate(bool)Control.Invalidate(Rectangle)Control.Invalidate(Rectangle, bool)Control.Invoke(Delegate)Control.Invoke(Delegate, params object[])Control.InvokePaint(Control, PaintEventArgs)Control.InvokePaintBackground(Control, PaintEventArgs)Control.IsKeyLocked(Keys)Control.IsInputChar(char)Control.IsMnemonic(char, string)Control.LogicalToDeviceUnits(int)Control.LogicalToDeviceUnits(Size)Control.ScaleBitmapLogicalToDevice(ref Bitmap)Control.NotifyInvalidate(Rectangle)Control.InvokeOnClick(Control, EventArgs)Control.OnBackgroundImageChanged(EventArgs)Control.OnBackgroundImageLayoutChanged(EventArgs)Control.OnCausesValidationChanged(EventArgs)Control.OnContextMenuChanged(EventArgs)Control.OnContextMenuStripChanged(EventArgs)Control.OnCursorChanged(EventArgs)Control.OnDockChanged(EventArgs)Control.OnNotifyMessage(Message)Control.OnParentBackColorChanged(EventArgs)Control.OnParentBackgroundImageChanged(EventArgs)Control.OnParentBindingContextChanged(EventArgs)Control.OnParentCursorChanged(EventArgs)Control.OnParentEnabledChanged(EventArgs)Control.OnParentFontChanged(EventArgs)Control.OnParentForeColorChanged(EventArgs)Control.OnParentRightToLeftChanged(EventArgs)Control.OnParentVisibleChanged(EventArgs)Control.OnPrint(PaintEventArgs)Control.OnTabIndexChanged(EventArgs)Control.OnTabStopChanged(EventArgs)Control.OnTextChanged(EventArgs)Control.OnClientSizeChanged(EventArgs)Control.OnControlAdded(ControlEventArgs)Control.OnControlRemoved(ControlEventArgs)Control.OnDragEnter(DragEventArgs)Control.OnDragOver(DragEventArgs)Control.OnDragLeave(EventArgs)Control.OnDragDrop(DragEventArgs)Control.OnGiveFeedback(GiveFeedbackEventArgs)Control.OnEnter(EventArgs)Control.InvokeGotFocus(Control, EventArgs)Control.OnHelpRequested(HelpEventArgs)Control.OnInvalidated(InvalidateEventArgs)Control.OnLeave(EventArgs)Control.InvokeLostFocus(Control, EventArgs)Control.OnMarginChanged(EventArgs)Control.OnMouseDoubleClick(MouseEventArgs)Control.OnMouseClick(MouseEventArgs)Control.OnDpiChangedBeforeParent(EventArgs)Control.OnDpiChangedAfterParent(EventArgs)Control.OnMove(EventArgs)Control.OnQueryContinueDrag(QueryContinueDragEventArgs)Control.OnRegionChanged(EventArgs)Control.OnResize(EventArgs)Control.OnSizeChanged(EventArgs)Control.OnChangeUICues(UICuesEventArgs)Control.OnStyleChanged(EventArgs)Control.OnSystemColorsChanged(EventArgs)Control.OnValidating(CancelEventArgs)Control.OnValidated(EventArgs)Control.RescaleConstantsForDpi(int, int)Control.PerformLayout()Control.PerformLayout(Control, string)Control.PointToClient(Point)Control.PointToScreen(Point)Control.PreProcessMessage(ref Message)Control.PreProcessControlMessage(ref Message)Control.ProcessCmdKey(ref Message, Keys)Control.ProcessDialogChar(char)Control.ProcessDialogKey(Keys)Control.ProcessKeyEventArgs(ref Message)Control.ProcessKeyMessage(ref Message)Control.ProcessKeyPreview(ref Message)Control.RaiseDragEvent(object, DragEventArgs)Control.RaisePaintEvent(object, PaintEventArgs)Control.RecreateHandle()Control.RectangleToClient(Rectangle)Control.RectangleToScreen(Rectangle)Control.ReflectMessage(IntPtr, ref Message)Control.ResetMouseEventArgs()Control.ResetText()Control.ResumeLayout()Control.ResumeLayout(bool)Control.Scale(SizeF)Control.Select()Control.Select(bool, bool)Control.SelectNextControl(Control, bool, bool, bool, bool)Control.SendToBack()Control.SetBounds(int, int, int, int)Control.SetBounds(int, int, int, int, BoundsSpecified)Control.SetClientSizeCore(int, int)Control.SizeFromClientSize(Size)Control.SetStyle(ControlStyles, bool)Control.SetTopLevel(bool)Control.SetVisibleCore(bool)Control.RtlTranslateAlignment(HorizontalAlignment)Control.RtlTranslateAlignment(LeftRightAlignment)Control.RtlTranslateAlignment(ContentAlignment)Control.RtlTranslateHorizontal(HorizontalAlignment)Control.RtlTranslateLeftRight(LeftRightAlignment)Control.RtlTranslateContent(ContentAlignment)Control.Show()Control.SuspendLayout()Control.Update()Control.UpdateBounds()Control.UpdateBounds(int, int, int, int)Control.UpdateBounds(int, int, int, int, int, int)Control.UpdateZOrder()Control.UpdateStyles()Control.OnImeModeChanged(EventArgs)Control.AccessibilityObjectControl.AccessibleDefaultActionDescriptionControl.AccessibleDescriptionControl.AccessibleNameControl.AccessibleRoleControl.AllowDropControl.AnchorControl.AutoScrollOffsetControl.LayoutEngineControl.BackgroundImageControl.BackgroundImageLayoutControl.BindingContextControl.BottomControl.BoundsControl.CanFocusControl.CanRaiseEventsControl.CanSelectControl.CaptureControl.CheckForIllegalCrossThreadCallsControl.ClientRectangleControl.ClientSizeControl.CompanyNameControl.ContainsFocusControl.ContextMenuControl.ContextMenuStripControl.ControlsControl.CreatedControl.CursorControl.DataBindingsControl.DefaultBackColorControl.DefaultCursorControl.DefaultFontControl.DefaultForeColorControl.DefaultMarginControl.DefaultMaximumSizeControl.DefaultMinimumSizeControl.DefaultPaddingControl.DeviceDpiControl.IsDisposedControl.DisposingControl.DockControl.DoubleBufferedControl.EnabledControl.FocusedControl.FontHeightControl.HandleControl.HasChildrenControl.HeightControl.IsHandleCreatedControl.InvokeRequiredControl.IsAccessibleControl.IsMirroredControl.LeftControl.LocationControl.MarginControl.ModifierKeysControl.MouseButtonsControl.MousePositionControl.NameControl.ParentControl.ProductNameControl.ProductVersionControl.RecreatingHandleControl.RegionControl.RenderRightToLeftControl.ResizeRedrawControl.RightControl.RightToLeftControl.ScaleChildrenControl.SizeControl.TabIndexControl.TabStopControl.TagControl.TopControl.TopLevelControlControl.ShowKeyboardCuesControl.ShowFocusCuesControl.UseWaitCursorControl.VisibleControl.WidthControl.PreferredSizeControl.CanEnableImeControl.DefaultImeModeControl.ImeModeControl.ImeModeBaseControl.PropagatingImeModeControl.BackColorChangedControl.BackgroundImageChangedControl.BackgroundImageLayoutChangedControl.BindingContextChangedControl.CausesValidationChangedControl.ClientSizeChangedControl.ContextMenuChangedControl.ContextMenuStripChangedControl.CursorChangedControl.DockChangedControl.EnabledChangedControl.FontChangedControl.ForeColorChangedControl.LocationChangedControl.MarginChangedControl.RegionChangedControl.RightToLeftChangedControl.SizeChangedControl.TabIndexChangedControl.TabStopChangedControl.TextChangedControl.VisibleChangedControl.ClickControl.ControlAddedControl.ControlRemovedControl.DragDropControl.DragEnterControl.DragOverControl.DragLeaveControl.GiveFeedbackControl.HandleCreatedControl.HandleDestroyedControl.HelpRequestedControl.InvalidatedControl.PaddingChangedControl.PaintControl.QueryContinueDragControl.QueryAccessibilityHelpControl.DoubleClickControl.EnterControl.GotFocusControl.KeyDownControl.KeyPressControl.KeyUpControl.LayoutControl.LeaveControl.LostFocusControl.MouseClickControl.MouseDoubleClickControl.MouseCaptureChangedControl.MouseDownControl.MouseEnterControl.MouseLeaveControl.DpiChangedBeforeParentControl.DpiChangedAfterParentControl.MouseHoverControl.MouseMoveControl.MouseUpControl.MouseWheelControl.MoveControl.PreviewKeyDownControl.ResizeControl.ChangeUICuesControl.StyleChangedControl.SystemColorsChangedControl.ValidatingControl.ValidatedControl.ParentChangedControl.ImeModeChangedComponent.Dispose()Component.GetService(Type)Component.ToString()Component.EventsComponent.ContainerComponent.DesignModeComponent.DisposedMarshalByRefObject.MemberwiseClone(bool)MarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.CreateObjRef(Type)

Constructors

RadWebCam()

Initializes a new instance of the RadWebCam class with default settings. The control will automatically start the first detected webcam when loaded.

Declaration

cs-api-definition
public RadWebCam()

Properties

AutoStart

Gets or sets whether the control will automatically start the first webcam it finds when the control is loaded.

Declaration

cs-api-definition
public bool AutoStart { get; set; }

Property Value

bool

CameraBorderElement

Gets the element representing the border of the camera.

Declaration

cs-api-definition
public LightVisualElement CameraBorderElement { get; }

Property Value

LightVisualElement

ControlPanelHeight

Gets or sets the height of the panel with the camera controls.

Declaration

cs-api-definition
public int ControlPanelHeight { get; set; }

Property Value

int

DefaultSize

Gets the default size of the control.

Declaration

cs-api-definition
protected override Size DefaultSize { get; }

Property Value

Size

Overrides Control.DefaultSize

HasError

Gets a value indicating whether the camera is in a state where something is preventing normal operation.

Declaration

cs-api-definition
public bool HasError { get; protected set; }

Property Value

bool

IsPreviewingSnapshot

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

Declaration

cs-api-definition
public bool IsPreviewingSnapshot { get; set; }

Property Value

bool

IsRecording

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

Declaration

cs-api-definition
public bool IsRecording { get; set; }

Property Value

bool

PreviewSnapshots

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

Declaration

cs-api-definition
public bool PreviewSnapshots { get; set; }

Property Value

bool

RecordingFilePath

Gets or sets the file path where video files are saved when recording from the webcam. Must be set before calling StartRecording() method.

Declaration

cs-api-definition
public string RecordingFilePath { get; set; }

Property Value

string

SnapshotPreviewElement

Gets the element used to display snapshot previews or error messages.

Declaration

cs-api-definition
public LightVisualElement SnapshotPreviewElement { get; }

Property Value

LightVisualElement

VideoRecordingElapsedTimeFormat

Gets or sets the format string for displaying elapsed time during video recording. Uses standard DateTime format strings.

Declaration

cs-api-definition
public string VideoRecordingElapsedTimeFormat { get; set; }

Property Value

string

WebCamElement

Gets the main web cam control element.

Declaration

cs-api-definition
public RadWebCamElement WebCamElement { get; }

Property Value

RadWebCamElement

Methods

CreateCameraBorderElement()

Creates the camera border element.

Declaration

cs-api-definition
protected virtual LightVisualElement CreateCameraBorderElement()

Returns

LightVisualElement

CreateChildItems(RadElement)

Creates and initializes the child elements of the RadWebCam control.

Declaration

cs-api-definition
protected override void CreateChildItems(RadElement parent)

Parameters

parent

RadElement

The root element of the control's element tree.

Overrides RadControl.CreateChildItems(RadElement)

CreateRootElement()

Creates the root RadElement of the control.

Declaration

cs-api-definition
protected override RootRadElement CreateRootElement()

Returns

RootRadElement

Overrides RadControl.CreateRootElement()

CreateSnapshotPreviewElement()

Creates the snapshot preview element.

Declaration

cs-api-definition
protected virtual LightVisualElement CreateSnapshotPreviewElement()

Returns

LightVisualElement

CreateWebCamElement()

Creates the main RadWebCam element.

Declaration

cs-api-definition
protected virtual RadWebCamElement CreateWebCamElement()

Returns

RadWebCamElement

CreateWebCamRootElement()

Creates the root element of RadWebCam.

Declaration

cs-api-definition
protected virtual WebCamRootRadElement CreateWebCamRootElement()

Returns

WebCamRootRadElement

DiscardSnapshot()

Discards the taken snapshot when the control is in preview snapshot mode.

Declaration

cs-api-definition
public virtual void DiscardSnapshot()

Dispose(bool)

Releases the unmanaged resources used by the RadWebCam control and its child controls and optionally releases the managed resources.

Declaration

cs-api-definition
protected override void Dispose(bool disposing)

Parameters

disposing

bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Overrides RadControl.Dispose(bool)

GetAudioCaptureDevices()

Gets a list with all the available audio capture devices on the system.

Declaration

cs-api-definition
public static ReadOnlyCollection<MediaFoundationDeviceInfo> GetAudioCaptureDevices()

Returns

ReadOnlyCollection<MediaFoundationDeviceInfo>

A read-only collection of audio capture devices available on the system.

GetVideoCaptureDevices()

Gets a list with all the available video capture devices (webcams) on the system.

Declaration

cs-api-definition
public static ReadOnlyCollection<MediaFoundationDeviceInfo> GetVideoCaptureDevices()

Returns

ReadOnlyCollection<MediaFoundationDeviceInfo>

A read-only collection of video capture devices available on the system.

GetVideoFormats(MediaFoundationDeviceInfo, bool)

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

Declaration

cs-api-definition
public static ReadOnlyCollection<MediaFoundationVideoFormatInfo> GetVideoFormats(MediaFoundationDeviceInfo device, bool recordingFormatsOnly = false)

Parameters

device

MediaFoundationDeviceInfo

The device for which to get the available formats.

recordingFormatsOnly

bool

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

Returns

ReadOnlyCollection<MediaFoundationVideoFormatInfo>

A read-only collection of video formats supported by the specified device.

Initialize(MediaFoundationDeviceInfo, MediaFoundationVideoFormatInfo)

Starts up the video pipeline and displays the video from the source inside of the control.

Declaration

cs-api-definition
public virtual void Initialize(MediaFoundationDeviceInfo videoDevice, MediaFoundationVideoFormatInfo videoFormat)

Parameters

videoDevice

MediaFoundationDeviceInfo

The device to use as a video source.

videoFormat

MediaFoundationVideoFormatInfo

The format from the video source.

Initialize(MediaFoundationDeviceInfo, MediaFoundationVideoFormatInfo, MediaFoundationDeviceInfo)

Starts up the video pipeline and displays the video from the source inside of the control with audio support.

Declaration

cs-api-definition
public virtual void Initialize(MediaFoundationDeviceInfo videoDevice, MediaFoundationVideoFormatInfo videoFormat, MediaFoundationDeviceInfo audioDevice)

Parameters

videoDevice

MediaFoundationDeviceInfo

The device to use as a video source.

videoFormat

MediaFoundationVideoFormatInfo

The format from the video source.

audioDevice

MediaFoundationDeviceInfo

The device to use as an audio source.

Exceptions

ArgumentNullException

Thrown when videoDevice or videoFormat is null.

OnCameraError(CameraErrorEventArgs)

Fires the CameraError event.

Declaration

cs-api-definition
protected virtual void OnCameraError(CameraErrorEventArgs e)

Parameters

e

CameraErrorEventArgs

The event arguments.

OnHandleCreated(EventArgs)

Raises the System.Windows.Forms.Control.HandleCreated event and initializes the default webcam if available.

Declaration

cs-api-definition
protected override void OnHandleCreated(EventArgs e)

Parameters

e

EventArgs

An EventArgs that contains the event data.

Overrides Control.OnHandleCreated(EventArgs)

OnLoad(Size)

Notifies that the control is about to be visualized and initializes the webcam position.

Declaration

cs-api-definition
protected override void OnLoad(Size desiredSize)

Parameters

desiredSize

Size

The desired size of the control.

Overrides RadControl.OnLoad(Size)

OnRecordingEnded(EventArgs)

Fires the RecordingEnded event.

Declaration

cs-api-definition
protected virtual void OnRecordingEnded(EventArgs e)

Parameters

e

EventArgs

The event arguments.

OnRecordingStarted(CancelEventArgs)

Fires the RecordingStarted event.

Declaration

cs-api-definition
protected virtual void OnRecordingStarted(CancelEventArgs e)

Parameters

e

CancelEventArgs

The event arguments.

OnSettingsDialogShowing(CameraSettingsDialogShowingEventArgs)

Fires the SettingsDialogShowing event.

Declaration

cs-api-definition
protected virtual void OnSettingsDialogShowing(CameraSettingsDialogShowingEventArgs e)

Parameters

e

CameraSettingsDialogShowingEventArgs

The event arguments.

OnSnapshotTaken(SnapshotTakenEventArgs)

Fires the SnapshotTaken event.

Declaration

cs-api-definition
protected virtual void OnSnapshotTaken(SnapshotTakenEventArgs e)

Parameters

e

SnapshotTakenEventArgs

The event arguments.

Pause()

Pauses the video pipeline and pauses displaying the video feed.

Declaration

cs-api-definition
public virtual void Pause()

SaveSnapshot()

Triggers the SnapshotTaken event when the control is in preview snapshot mode.

Declaration

cs-api-definition
public virtual void SaveSnapshot()

SetBoundsCore(int, int, int, int, BoundsSpecified)

Performs the work of setting the specified bounds of this control and updates the webcam stream position.

Declaration

cs-api-definition
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)

Parameters

x

int

The new x-coordinate of the control.

y

int

The new y-coordinate of the control.

width

int

The new width of the control.

height

int

The new height of the control.

specified

BoundsSpecified

A bitwise combination of BoundsSpecified values.

Overrides RadControl.SetBoundsCore(int, int, int, int, BoundsSpecified)

ShowSettingsDialog()

Shows the camera settings dialog which allows configuring camera properties. The SettingsDialogShowing event can be used to customize or cancel the dialog.

Declaration

cs-api-definition
public virtual void ShowSettingsDialog()

ShutDown()

Shuts down the video pipeline.

Declaration

cs-api-definition
public virtual void ShutDown()

Start()

Starts the video pipeline and starts displaying the video feed.

Declaration

cs-api-definition
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

cs-api-definition
public virtual void StartRecording()

Stop()

Stops the video pipeline and stops displaying the video feed.

Declaration

cs-api-definition
public virtual void Stop()

StopRecording()

Stops the file capture.

Declaration

cs-api-definition
public virtual void StopRecording()

TakeSnapshot()

Takes a snapshot from the currently displayed webcam video feed. If PreviewSnapshots is true, the snapshot will be displayed for preview before firing the SnapshotTaken event. Otherwise, the SnapshotTaken event will be fired immediately.

Declaration

cs-api-definition
public virtual void TakeSnapshot()

Events

CameraError

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

Declaration

cs-api-definition
public event EventHandler<CameraErrorEventArgs> CameraError

Event Value

EventHandler<CameraErrorEventArgs>

RecordingEnded

Occurs when video recording has ended.

Declaration

cs-api-definition
public event EventHandler RecordingEnded

Event Value

EventHandler

RecordingStarted

Occurs when video recording is started.

Declaration

cs-api-definition
public event EventHandler<CancelEventArgs> RecordingStarted

Event Value

EventHandler<CancelEventArgs>

SettingsDialogShowing

Occurs when the settings dialog is about to be shown.

Declaration

cs-api-definition
public event EventHandler<CameraSettingsDialogShowingEventArgs> SettingsDialogShowing

Event Value

EventHandler<CameraSettingsDialogShowingEventArgs>

SnapshotTaken

Occurs when a snapshot is taken from the webcam. If PreviewSnapshots is set to true, the event is fired only when the SaveSnapshot() method is called.

Declaration

cs-api-definition
public event EventHandler<SnapshotTakenEventArgs> SnapshotTaken

Event Value

EventHandler<SnapshotTakenEventArgs>