📄 prefer.frm
字号:
VERSION 5.00
Begin VB.Form frmPreferences
BorderStyle = 3 'Fixed Dialog
Caption = "扫描参数设置"
ClientHeight = 4410
ClientLeft = 45
ClientTop = 330
ClientWidth = 5535
Icon = "Prefer.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4410
ScaleWidth = 5535
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtScanToDirectory
Height = 315
Left = 1800
TabIndex = 5
Top = 3240
Width = 3495
End
Begin VB.OptionButton optScanSettings
Caption = "显示扫描自带扫描界面"
Height = 375
Index = 1
Left = 240
TabIndex = 4
Top = 2520
Width = 3735
End
Begin VB.OptionButton optScanSettings
Caption = "使用定义好的扫描设置"
Height = 375
Index = 0
Left = 240
TabIndex = 0
Top = 240
Width = 3495
End
Begin VB.CheckBox chkUseADF
Caption = "使用自动文档进纸"
Height = 255
Left = 720
TabIndex = 3
Top = 1920
Width = 3255
End
Begin VB.CommandButton cmdCancel
Caption = "Cancel"
Height = 375
Left = 3000
TabIndex = 7
Top = 3840
Width = 1212
End
Begin VB.CommandButton cmdOK
Caption = "OK"
Default = -1 'True
Height = 375
Left = 1320
TabIndex = 6
Top = 3840
Width = 1212
End
Begin VB.Frame fraOriginalDocument
Caption = "原文档"
Height = 975
Left = 600
TabIndex = 8
Top = 720
Width = 4695
Begin VB.CommandButton cmdSettings
Caption = "设置..."
Height = 375
Left = 3120
TabIndex = 2
Top = 360
Width = 1215
End
Begin VB.ComboBox cboDocumentType
Height = 315
Left = 360
Style = 2 'Dropdown List
TabIndex = 1
Top = 360
Width = 2412
End
End
Begin VB.Label lblSaveDocumentIn
BackStyle = 0 'Transparent
Caption = "文档存放位置:"
Height = 255
Left = 240
TabIndex = 9
Top = 3240
Width = 1455
End
End
Attribute VB_Name = "frmPreferences"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cboDocumentType_Click()
'**************************************************************
' PRIVATE SUB cboDocumentType_Click
'**************************************************************
Select Case cboDocumentType.ListIndex
Case dtTextOnly, dtCustom
gintColorIndex = clBlackAndWhite
gintHorizontalDPI = 200
gintVerticalDPI = 200
gintPaperSizeIndex = psLetter
Case dtArticle
gintColorIndex = cl256ShadesOfGray
gintHorizontalDPI = 200
gintVerticalDPI = 200
gintPaperSizeIndex = psLetter
Case dtColorArticle
gintColorIndex = cl256Colors
gintHorizontalDPI = 200
gintVerticalDPI = 200
gintPaperSizeIndex = psLetter
Case dtPhotograph
gintColorIndex = clTrueColor
gintHorizontalDPI = 100
gintVerticalDPI = 100
gintPaperSizeIndex = psPhoto
Case dtBusinessCard
gintColorIndex = cl256Colors
gintHorizontalDPI = 300
gintVerticalDPI = 300
gintPaperSizeIndex = psBusinessCard
Case dtLineDrawing
gintColorIndex = clBlackAndWhite
gintHorizontalDPI = 300
gintVerticalDPI = 300
gintPaperSizeIndex = psLetter
Case dtPoorQuality
gintColorIndex = cl16ShadesOfGray
gintHorizontalDPI = 200
gintVerticalDPI = 200
gintPaperSizeIndex = psLetter
Case dtLegalDocument
gintColorIndex = clBlackAndWhite
gintHorizontalDPI = 200
gintVerticalDPI = 200
gintPaperSizeIndex = psLegal
End Select
Call frmSettings.SetPaperSize(gintPaperSizeIndex)
End Sub
Private Sub cmdCancel_Click()
'**************************************************************
' PRIVATE SUB cmdCancel
'**************************************************************
Unload Me
End Sub
Private Sub cmdOK_Click()
'**************************************************************
' PRIVATE SUB cmdOK_Click: Convert the page number text
' from the combo box to a long and display the new page.
'**************************************************************
'** Booleans
Dim blnRegenThumbs As Boolean
'** Integers
Dim intIndex As Integer
'** Longs
Dim lngStartPageNo As Long
Dim lngEndPageNo As Long
'** Strings
Dim strScanToDirectory As String
'** Variants
Dim vntWorkingString As Variant
'----------------------------------------------------------
' Save the screen values to global variables.
'----------------------------------------------------------
If optScanSettings(0).Value = True Then
gintScanSettings = 0
Else
gintScanSettings = 1
End If
gintDocumentTypeIndex = cboDocumentType.ListIndex
gblnUseADF = chkUseADF.Value
'----------------------------------------------------------
' If the Scan To directory is valid, store it; otherwise,
' declare an error.
'----------------------------------------------------------
strScanToDirectory = Dir(txtScanToDirectory.Text, vbDirectory)
If strScanToDirectory <> "" Then
If Right(txtScanToDirectory.Text, 1) = "\" Then
txtScanToDirectory.Text = Left$(txtScanToDirectory.Text, Len(txtScanToDirectory.Text) - 1)
End If
gstrScanToDirectory = txtScanToDirectory.Text
Else
MsgBox CANT_ACCESS_DIR & """" & txtScanToDirectory.Text & """.", vbCritical + vbOKOnly
Exit Sub
End If
'----------------------------------------------------------
' Save the preferences to the Windows Registry, and unload
' the frmSettings form.
'----------------------------------------------------------
Call GetSaveUserPreferences("Save")
Unload Me
End Sub
Private Sub cmdSettings_Click()
'**************************************************************
' PRIVATE SUB cmdSettings_Click
'**************************************************************
frmSettings.Show vbModal
End Sub
Private Sub Form_Load()
'**************************************************************
' PRIVATE SUB Form_Load
'**************************************************************
'----------------------------------------------------------
' Set the control values based on global variables.
'----------------------------------------------------------
optScanSettings(gintScanSettings).Value = True
chkUseADF.Value = Abs(gblnUseADF)
txtScanToDirectory = gstrScanToDirectory
'----------------------------------------------------------
' Populate the cboDocumentType combo box with the list of
' available document types.
'----------------------------------------------------------
cboDocumentType.AddItem "Text only"
cboDocumentType.AddItem "Article"
cboDocumentType.AddItem "Color Article"
cboDocumentType.AddItem "Photograph"
cboDocumentType.AddItem "Business Card"
cboDocumentType.AddItem "Line Drawing"
cboDocumentType.AddItem "Poor Quality"
cboDocumentType.AddItem "Legal Document"
cboDocumentType.AddItem "Custom"
cboDocumentType.ListIndex = gintDocumentTypeIndex
End Sub
Private Sub optScanSettings_Click(Index As Integer)
'**************************************************************
' PRIVATE SUB optScanSettings_Click:
'**************************************************************
Select Case Index
Case 0 'Use this flow's scan settings
cboDocumentType.Enabled = True
cmdSettings.Enabled = True
chkUseADF.Enabled = True
Case 1 'Display TWAIN user interface
cboDocumentType.Enabled = False
cmdSettings.Enabled = False
chkUseADF.Enabled = False
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -