⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classvideocapture.cls

📁 实现 USB 图象采集 实现 USB 图象采集
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ClassVideoCapture"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Dim initialised As Integer
Dim image_raw As classImageProcessing
Dim image_edges As classImageProcessing
Dim image_rgb(3) As classImageProcessing

Public processEdges As Boolean
Public processRGB As Boolean


Public Sub init(image_Width As Integer, image_height As Integer)
  
  Dim i As Integer
  
  Set image_raw = New classImageProcessing
  Call image_raw.init(image_Width, image_height)
  image_raw.processType = 0
  
  Set image_edges = New classImageProcessing
  Call image_edges.init(image_Width, image_height)
  image_raw.processType = 0
  
  For i = 0 To 2
    Set image_rgb(i) = New classImageProcessing
    Call image_rgb(i).init(image_Width, image_height)
    image_rgb(i).processType = i + 1
  Next
  
  initialised = 1
  
End Sub


Public Sub update(canvas As PictureBox)
  Dim i As Integer
  
  If (initialised = 1) Then
    Call image_raw.update(canvas)
    If (processEdges) Then
      Call image_edges.getImageContours(image_raw)
    End If
    If (processRGB) Then
      For i = 0 To 2
        Call image_rgb(i).update(canvas)
      Next
    End If
  End If
End Sub


Public Sub showRawImage(canvas As PictureBox)
  Call image_raw.show(canvas)
End Sub

Public Sub showEdgesImage(canvas As PictureBox)
  Call image_edges.show(canvas)
End Sub

Public Sub showRGBImage(canvas As PictureBox, primaryColourIndex As Integer)
  Call image_rgb(primaryColourIndex).show(canvas)
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -