Snapshots

RadWebCam allows you to snapshot the currently displayed video feed. This can be done via the "Take snapshot" button of the control, or the TakeSnapshot method. This will fire the SnapshotTaken event where you can get the BitmapSource object with the image.

Figure 1: Take snapshot button

Example 1: Taking a snapshot in code

public MainWindow() 
{ 
    InitializeComponent();       
    this.radWebCam.SnapshotTaken += RadWebCam_SnapshotTaken; 
} 
 
public void OnTakeSnapshot() 
{ 
    this.radWebCam.TakeSnapshot(); 
} 
 
private void RadWebCam_SnapshotTaken(object sender, SnapshotTakenEventArgs e) 
{ 
    BitmapSource snapshot = e.Snapshot; 
    // here you save the source to a file, in memory, or to show it in the UI 
} 
To discard the snapshot preview, call the DiscardSnapshot method of RadWebCam. The method works only when a snapshot is taken and is currently being previewed.

Additionally, there is a SaveSnapshot method which fires the SnapshotTaken event. The method works only when a snapshot is taken and is currently being previewed.

Preview Snapshots

By default when you take a snapshot a preview of the image will be shown. To disable this, set the PreviewSnapshots property to False.

Example 2: Disable snapshots preview in XAML

<telerik:RadWebCam PreviewSnapshots="False" /> 

Example 3: Disable snapshots preview in code

this.radWebCam.PreviewSnapshots = false; 
You can indicate if the snapshot preview is displayed via the IsPreviewingSnapshot property of RadWebCam.

See Also

In this article
Not finding the help you need? Improve this article