📄 scanmain.frm
字号:
VERSION 5.00
Object = "{6D940288-9F11-11CE-83FD-02608C3EC08A}#2.2#0"; "ImgEdit.ocx"
Object = "{009541A3-3B81-101C-92F3-040224009C02}#2.1#0"; "ImgAdmin.ocx"
Object = "{84926CA3-2941-101C-816F-0E6013114B7F}#1.0#0"; "ImgScan.ocx"
Begin VB.Form frmScan
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "进行扫描档案入库 :-) Scan Files To Cabinet"
ClientHeight = 5355
ClientLeft = 150
ClientTop = 720
ClientWidth = 7590
Icon = "scanmain.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5355
ScaleWidth = 7590
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin ScanLibCtl.ImgScan ImgScan1
Left = 300
Top = 2790
_Version = 65536
_ExtentX = 847
_ExtentY = 767
_StockProps = 0
DestImageControl= "ImgEdit1"
End
Begin ImgeditLibCtl.ImgEdit ImgEdit1
Height = 5175
Left = 90
TabIndex = 0
Top = 75
Width = 7410
_Version = 131074
_ExtentX = 13070
_ExtentY = 9128
_StockProps = 96
ImageControl = "ImgEdit1"
BeginProperty AnnotationFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BorderStyle = 0
UndoBufferSize = 293856512
OcrZoneVisibility= -3516
AnnotationOcrType= 25649
ForceFileLinking1x= -1 'True
MagnifierZoom = 25649
sReserved1 = -3516
sReserved2 = -3516
lReserved1 = 1241728
lReserved2 = 1241728
bReserved1 = -1 'True
bReserved2 = -1 'True
End
Begin VB.Line Line4
BorderColor = &H00FFFFFF&
X1 = 7545
X2 = 7545
Y1 = 30
Y2 = 5295
End
Begin VB.Line Line3
BorderColor = &H00FFFFFF&
X1 = 30
X2 = 7560
Y1 = 5295
Y2 = 5295
End
Begin VB.Line Line2
BorderColor = &H00808080&
X1 = 45
X2 = 7545
Y1 = 15
Y2 = 15
End
Begin VB.Line Line1
BorderColor = &H00808080&
X1 = 45
X2 = 45
Y1 = 15
Y2 = 5295
End
Begin AdminLibCtl.ImgAdmin ImgAdmin1
Left = 360
Top = 2295
_Version = 131073
_ExtentX = 714
_ExtentY = 661
_StockProps = 0
PrintStartPage = 0
PrintEndPage = 0
End
Begin VB.Menu MnuFile
Caption = "扫描操作(&F)"
Begin VB.Menu MnuOpen
Caption = "打开文件(&O) ..."
Shortcut = ^O
End
Begin VB.Menu dddd
Caption = "-"
End
Begin VB.Menu mnuSaveit
Caption = "保存文件(&S) ..."
End
Begin VB.Menu mnuSave
Caption = "另存为文件(&S) ..."
Shortcut = ^S
End
Begin VB.Menu afsdf
Caption = "-"
End
Begin VB.Menu mnuHorstory
Caption = "图片垂直翻转(&V)"
End
Begin VB.Menu mnuHHV
Caption = "图片逆时针90度翻转"
End
Begin VB.Menu mnuHV
Caption = "图片顺时钟90度翻转"
End
Begin VB.Menu step11
Caption = "-"
End
Begin VB.Menu MnuScan
Caption = "扫描文件(&C) ..."
Shortcut = {F6}
End
Begin VB.Menu step10
Caption = "-"
End
Begin VB.Menu MnuExit
Caption = "关闭窗口(&X)"
Shortcut = ^X
End
End
End
Attribute VB_Name = "frmScan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
GetFormSet Me, Screen
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveFormSet Me
End Sub
Private Sub MnuExit_Click()
'文件名送回
Unload Me
End Sub
Private Sub MnuFile_Click()
'显示当前状态是否有数据
On Error GoTo Novaloid
If ImgEdit1.ImageDisplayed = True Then
mnuHorstory.Enabled = True
mnuHV.Enabled = True
mnuHHV.Enabled = True
mnuSave.Enabled = True
'有修改,而且打开时,保存为效
If ImgAdmin1.Image <> "" And ImgEdit1.ImageModified = True Then
mnuSaveit.Enabled = True
End If
Else
mnuHHV.Enabled = False
mnuHorstory.Enabled = False
mnuHV.Enabled = False
mnuSaveit.Enabled = False
mnuSave.Enabled = False
End If
Exit Sub
Novaloid:
mnuHorstory.Enabled = False
mnuHV.Enabled = False
Exit Sub
End Sub
Private Sub mnuHHV_Click()
On Error GoTo RotateERR
ImgEdit1.RotateLeft
Exit Sub
RotateERR:
Exit Sub
End Sub
Private Sub mnuHorstory_Click()
On Error Resume Next
ImgEdit1.Flip
End Sub
Private Sub mnuHV_Click()
On Error GoTo RotateERR
ImgEdit1.RotateRight
Exit Sub
RotateERR:
Exit Sub
End Sub
Private Sub MnuOpen_Click()
ImgAdmin1.DialogTitle = "打开已经存在的图像文件"
ImgAdmin1.CancelError = True
ImgAdmin1.InitDir = App.Path + "\File"
On Error GoTo CancelF
ImgAdmin1.Image = ""
ImgAdmin1.Flags = cdlOFNHideReadOnly + cdlOFNFileMustExist
ImgAdmin1.ShowFileDialog OpenDlg
ImgEdit1.Image = ImgAdmin1.Image
ImgEdit1.Display
ScanFileName = ImgAdmin1.Image
Exit Sub
CancelF:
If Err.Number <> 32755 Then
MsgBox "非法操作,不能继续操作!", vbOKOnly + vbQuestion, "不能打开"
Else
ImgAdmin1.Image = ""
End If
End Sub
Private Sub MnuSave_Click()
ImgAdmin1.DialogTitle = "保存图像文件"
ImgAdmin1.CancelError = True
ImgAdmin1.InitDir = sFilePath
On Error GoTo CancelF
ImgAdmin1.Image = ""
ImgAdmin1.Filter = "压缩图片(*.jpg)|*.jpg|"
ImgAdmin1.ShowFileDialog SaveDlg
If InStr(1, UCase(ImgAdmin1.Image), UCase(".jpg"), vbTextCompare) Then
ImgEdit1.SaveAs ImgAdmin1.Image, 6, 7, 1, 0, False
ScanFileName = ImgAdmin1.Image
Else
ImgEdit1.SaveAs ImgAdmin1.Image & ".jpg", 6, 7, 1, 0, False
ScanFileName = ImgAdmin1.Image & ".jpg"
End If
Exit Sub
CancelF:
If Err.Number <> 32755 Then
MsgBox "保存扫描图片错误:" & Err.Description, vbOKOnly + vbQuestion, "不能保存"
Else
ImgAdmin1.Image = ""
End If
End Sub
Private Sub mnuSaveit_Click()
On Error GoTo SaveERR
ImgEdit1.Save
Exit Sub
SaveERR:
MsgBox "保存图片错误:" & Err.Description, vbInformation
End Sub
Private Sub MnuScan_Click()
ImgScan1.DestImageControl = "ImgEdit1"
On Error GoTo NoDevice
ImgScan1.StartScan
Exit Sub
NoDevice:
If Err.Number = 1117 Then
MsgBox "扫描设备没有找到,请重新安装!", vbOKOnly + vbCritical, "没有寻找到扫描设备"
Exit Sub
Else
MsgBox "系统未知错误,不能继续!", vbOKOnly + vbCritical, "未知错误"
Exit Sub
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -