sub Main
'图像捕捉线程
dim Thd_WHM_PicCap = New Threading.Thread(AddressOf WHM_Pic_Cap)
Thd_WHM_PicCap.Start()
end main
''' <summary>
''' 捕获波高图像
''' </summary>
Sub WHM_Pic_Cap()
On Error GoTo ErrHand
'使用秒表来计时,防止系统的触发时间机制
Dim cStopWatch As New Stopwatch
cStopWatch.Start()
Dim CBMP As Bitmap
Do
'全局变量,退出循环
If Not IsWHMPicCapturingStatue Then Exit Do
'***** 采集图像 ******
‘WHM_WDMIAT 图像工具的.net对象
WHM_WDMIAT.MemorySnapImage()
CBMP = WHM_WDMIAT.ImageActiveBuffer().Bitmap
Loop
ExitHand: Return
ErrHand: Dim ErrString = Date.Now & " 错误" & Err.Number & ":" & Err.Description : TsslMain.Text = ErrString
Resume Next
End Sub