一个驱动webcam的类,利用通用的摄像头驱动程序avicap32.dll
Imports System.Runtime.InteropServices
Public Class Form1
Inherits System.Windows.Forms.Form#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()This call is required by the Windows Form Designer.
InitializeComponent()Add any initialization after the InitializeComponent() call
End Sub
Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End SubRequired by the Windows Form Designer
Private components As System.ComponentModel.IContainerNOTE: The following procedure is required by the Windows Form Designer
It can be modified using the Windows Form Designer.
Do not modify it using the code editor.
Friend WithEvents picCapture As System.Windows.Forms.PictureBox
Friend WithEvents lstDevices As System.Windows.Forms.ListBox
Friend WithEvents lblDevice As System.Windows.Forms.Label
Friend WithEvents btnStart As System.Windows.Forms.Button
Friend WithEvents btnSave As System.Windows.Forms.Button
Friend WithEvents btnStop As System.Windows.Forms.Button
Friend WithEvents sfdImage As System.Windows.Forms.SaveFileDialog
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.picCapture = New System.Windows.Forms.PictureBox()
Me.lstDevices = New System.Windows.Forms.ListBox()
Me.lblDevice = New System.Windows.Forms.Label()
Me.btnStart = New System.Windows.Forms.Button()
Me.btnSave = New System.Windows.Forms.Button()
Me.btnStop = New System.Windows.Forms.Button()
Me.sfdImage = New System.Windows.Forms.SaveFileDialog()
Me.SuspendLayout()
picCapture
Me.picCapture.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.picCapture.Location = New System.Drawing.Point(208, 24)
Me.picCapture.Name = "picCapture"
Me.picCapture.Size = New System.Drawing.Size(256, 272)
Me.picCapture.TabIndex = 0
Me.picCapture.TabStop = False
lstDevices
Me.lstDevices.Location = New System.Drawing.Point(8, 55)
Me.lstDevices.Name = "lstDevices"
Me.lstDevices.Size = New System.Drawing.Size(184, 238)
Me.lstDevices.TabIndex = 1
lblDevice
Me.lblDevice.Location = New System.Drawing.Point(8, 32)
Me.lblDevice.Name = "lblDevice"
Me.lblDevice.Size = New System.Drawing.Size(184, 16)
Me.lblDevice.TabIndex = 2
Me.lblDevice.Text = "Available Devices"
Me.lblDevice.TextAlign = System.Drawing.ContentAlignment.TopCenter
btnStart
Me.btnStart.Location = New System.Drawing.Point(20, 320)
Me.btnStart.Name = "btnStart"
Me.btnStart.Size = New System.Drawing.Size(112, 32)
Me.btnStart.TabIndex = 3
Me.btnStart.Text = "Start Preview"
btnSave
Me.btnSave.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
Me.btnSave.Location = New System.Drawing.Point(348, 320)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(112, 32)
Me.btnSave.TabIndex = 4
Me.btnSave.Text = "Save Image"
btnStop
Me.btnStop.Location = New System.Drawing.Point(184, 320)
Me.btnStop.Name = "btnStop"
Me.btnStop.Size = New System.Drawing.Size(112, 32)
Me.btnStop.TabIndex = 5
Me.btnStop.Text = "Stop Preview"
sfdImage
Me.sfdImage.FileName = "Webcam1"
Me.sfdImage.Filter = "Bitmap|*.bmp"
Form1
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSiz
补充:Web开发 , ASP.Net ,