?? dlgidcardandperson.frm
字號:
VERSION 5.00
Object = "{0B81E4A9-BE4E-4AEF-9272-33AB5B51C6FC}#1.0#0"; "XPControls.ocx"
Begin VB.Form dlgIDCardAndPerson
BackColor = &H80000018&
BorderStyle = 3 'Fixed Dialog
Caption = "攝像和身份證掃描"
ClientHeight = 4875
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 7815
Icon = "dlgIDCardAndPerson.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4875
ScaleWidth = 7815
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame3
BackColor = &H80000018&
Caption = "操作"
Height = 915
Left = 5580
TabIndex = 3
Top = 3750
Width = 2025
Begin XPControls.XPCommandButton cmdCancel
Cancel = -1 'True
Height = 345
Left = 1110
TabIndex = 4
Top = 360
Width = 780
_ExtentX = 1376
_ExtentY = 609
Caption = "取消(&C)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdOK
Default = -1 'True
Height = 345
Left = 120
TabIndex = 5
Top = 360
Width = 795
_ExtentX = 1402
_ExtentY = 609
Caption = "確定(&O)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Begin VB.Frame Frame2
BackColor = &H80000018&
Caption = "圖像來源"
Height = 3345
Left = 5580
TabIndex = 2
Top = 240
Width = 2025
Begin VB.Frame Frame5
BackColor = &H80000018&
Caption = "掃描儀"
Height = 1215
Left = 150
TabIndex = 8
Top = 2040
Width = 1725
Begin XPControls.XPCommandButton cmdSelectScan
Height = 375
Left = 300
TabIndex = 13
Top = 270
Width = 1125
_ExtentX = 1984
_ExtentY = 661
Caption = "選擇源設備"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdScan
Height = 375
Left = 300
TabIndex = 9
Top = 750
Width = 1125
_ExtentX = 1984
_ExtentY = 661
Caption = "開始掃描"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Begin VB.Frame Frame4
BackColor = &H80000018&
Caption = "攝像頭"
Height = 1695
Left = 150
TabIndex = 6
Top = 240
Width = 1725
Begin XPControls.XPCommandButton cmdSelectCamara
Height = 375
Left = 300
TabIndex = 14
Top = 270
Width = 1125
_ExtentX = 1984
_ExtentY = 661
Caption = "選擇源設備"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdAccept
Height = 375
Left = 300
TabIndex = 10
Top = 1200
Width = 1125
_ExtentX = 1984
_ExtentY = 661
Caption = "接 受"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdPhotography
Height = 375
Left = 300
TabIndex = 7
Top = 735
Width = 1125
_ExtentX = 1984
_ExtentY = 661
Caption = "開始攝像"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
End
Begin VB.Frame Frame1
BackColor = &H80000018&
Caption = "攝像或身份證圖片"
Height = 4425
Left = 180
TabIndex = 0
Top = 240
Width = 5265
Begin VB.PictureBox picScan
Height = 4005
Left = 150
ScaleHeight = 3945
ScaleWidth = 4905
TabIndex = 12
Top = 300
Width = 4965
End
Begin VB.PictureBox picAccept
Height = 4005
Left = 150
ScaleHeight = 3945
ScaleWidth = 4905
TabIndex = 11
Top = 300
Width = 4965
End
Begin VB.PictureBox picPhotography
Height = 4005
Left = 150
ScaleHeight = 3945
ScaleWidth = 4905
TabIndex = 1
Top = 300
Width = 4965
End
End
End
Attribute VB_Name = "dlgIDCardAndPerson"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim m_strPhotoFile As String
Dim m_strScanFile As String
Private Sub cmdAccept_Click()
Call capEditCopy(lwndC)
picAccept.PICTURE = Clipboard.GetData()
'顯示攝像
picAccept.ZOrder 0
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
'保存圖像
If picAccept.PICTURE <> 0 Then
Call SavePicture(picAccept.PICTURE, m_strPhotoFile)
End If
If picScan.PICTURE <> 0 Then
Call SavePicture(picScan.PICTURE, m_strScanFile)
End If
Unload Me
End Sub
Private Sub cmdPhotography_Click()
'顯示攝像窗口
picPhotography.ZOrder 0
End Sub
Private Sub cmdScan_Click()
On Error GoTo ErrMsg
Dim Status
Dim lngRet As Long
Dim intT As Integer
lngRet = TWAIN_AcquireToClipboard(Me.hwnd, intT)
picScan.PICTURE = Clipboard.GetData(vbCFDIB)
picScan.ZOrder 0
GoTo ExitLab
ErrMsg:
Status = SetError(Err.Number, Err.Description, Err.Description)
ErrMsg Status
ExitLab:
'
End Sub
Private Sub cmdSelectCamara_Click()
' /*
' * Display the Video Source dialog when "Source" is selected from the
' * menu bar.
' */
capDlgVideoSource lwndC
End Sub
Private Sub cmdSelectScan_Click()
On Error GoTo er
Dim lngRet As Long
lngRet = TWAIN_SelectImageSource(Me.hwnd)
Exit Sub
er:
MsgBox Err.Description
End Sub
Private Sub Form_Load()
Dim lpszName As String * 100
Dim lpszVer As String * 100
Dim Caps As CAPDRIVERCAPS
'//Create Capture Window
' capGetDriverDescriptionA 0, lpszName, 100, lpszVer, 100 '// Retrieves driver info
lwndC = capCreateCaptureWindowA(lpszName, _
WS_THICKFRAME Or WS_VISIBLE Or WS_CHILD, _
0, 0, Me.picPhotography.ScaleWidth, Me.picPhotography.ScaleHeight, _
Me.picPhotography.hwnd, 0)
'// Set title of window to name of driver
' SetWindowText lwndC, lpszName
' lwndC = Me.Picture1.hWnd
' Call SetResize(Me.Picture1.hWnd, Me.hWnd)
'// Set the video stream callback function
capSetCallbackOnStatus lwndC, AddressOf MyStatusCallback
capSetCallbackOnError lwndC, AddressOf MyErrorCallback
'// Connect the capture window to the driver
If capDriverConnect(lwndC, 0) Then
'/////
'// Only do the following if the connect was successful.
'// if it fails, the error will be reported in the call
'// back function.
'/////
'// Get the capabilities of the capture driver
capDriverGetCaps lwndC, VarPtr(Caps), Len(Caps)
'// If the capture driver does not support a dialog, grey it out
'// in the menu bar.
If Caps.fHasDlgVideoSource = 0 Then cmdSelectCamara.Enabled = False
' If Caps.fHasDlgVideoFormat = 0 Then mnuFormat.Enabled = False
' If Caps.fHasDlgVideoDisplay = 0 Then mnuDisplay.Enabled = False
'// Turn Scale on
capPreviewScale lwndC, True
'// Set the preview rate in milliseconds
capPreviewRate lwndC, 66
'// Start previewing the image from the camera
capPreview lwndC, True
'// Resize the capture window to show the whole image
ResizeCaptureWindow lwndC
End If
'Begin photography
cmdPhotography_Click
'指定圖像路徑
m_strPhotoFile = GetTempPathW & "Photo.jpg"
m_strScanFile = GetTempPathW & "scan.jpg"
If Dir(m_strPhotoFile) <> "" Then Kill m_strPhotoFile
If Dir(m_strScanFile) <> "" Then Kill m_strScanFile
End Sub
Private Sub Form_Unload(Cancel As Integer)
'// Disable all callbacks
capSetCallbackOnError lwndC, vbNull
capSetCallbackOnStatus lwndC, vbNull
capSetCallbackOnYield lwndC, vbNull
capSetCallbackOnFrame lwndC, vbNull
capSetCallbackOnVideoStream lwndC, vbNull
capSetCallbackOnWaveStream lwndC, vbNull
capSetCallbackOnCapControl lwndC, vbNull
End Sub
'被調函數
'返回值:照片路徑+|+身份證路徑
Public Function ShowPhotoAndScan() As String
Me.Show vbModal
If Dir(m_strPhotoFile) = "" Then m_strPhotoFile = ""
If Dir(m_strScanFile) = "" Then m_strScanFile = ""
If (m_strPhotoFile <> "") Or (m_strScanFile <> "") Then
ShowPhotoAndScan = m_strPhotoFile & "|" & m_strScanFile
End If
End Function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -