Telerik UI for WinForms?下载30天免费试用

快照

RadWebCam允许您对当前显示的视频提要进行快照。这可以通过控件的“拍摄快照”按钮或TakeSnapshot方法。这将触发SnapshotTaken事件,你可以得到Image对象。

WinForms RadWebcam快照

在代码中进行快照

public WebCamFeatures() {InitializeComponent();this.radWebCam1。SnapshotTaken+= radWebCam1_SnapshotTaken; } private void radWebCam1_SnapshotTaken(object sender, Telerik.WinControls.UI.SnapshotTakenEventArgs e) { Image snapshot = e.Snapshot; // here you save the image to a file, in memory, or to show it in the UI } private void OnTakeSnapshot(object sender, EventArgs e) { this.radWebCam1.TakeSnapshot(); }
Public Sub New() InitializeComponent() AddHandler Me.RadWebCam1。SnapshotTaken, AddressOf radWebCam1_SnapshotTaken End Sub Private Sub radWebCam1_SnapshotTaken(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.SnapshotTakenEventArgs) Dim snapshot As Image = e.Snapshot End Sub Private Sub OnTakeSnapshot(ByVal sender As Object, ByVal e As EventArgs) Me.RadWebCam1.TakeSnapshot() End Sub

快照预览

默认情况下,当您拍摄快照时,将显示图像的预览。要禁用此功能,请设置PreviewSnapshots财产

this.radWebCam1。PreviewSnapshots = false;

控件可以指示是否显示快照预览IsPreviewingSnapshot的属性RadWebCam

另请参阅

在本文中
Baidu
map