📄 compress.frm
字号:
VERSION 5.00
Begin VB.Form frmCompress
BorderStyle = 3 'Fixed Dialog
Caption = "压缩"
ClientHeight = 5985
ClientLeft = 1515
ClientTop = 810
ClientWidth = 10095
Icon = "Compress.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 5985
ScaleWidth = 10095
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame fraGet
Caption = "得到压缩选项"
Height = 1575
Left = 5760
TabIndex = 27
Top = 240
Width = 4095
Begin VB.CommandButton cmdGet
Caption = "获取"
Height = 375
Left = 3120
TabIndex = 29
Top = 960
Width = 735
End
Begin VB.Label lblGet
Caption = "三种扫描压缩情况: GetCompressionPreference, GetPageTypeCompressionType, and GetPageTypeCompressionInfo."
Height = 1095
Left = 240
TabIndex = 28
Top = 360
Width = 3375
End
End
Begin VB.Frame fraSet
Caption = "设置压缩选项"
Height = 1575
Left = 240
TabIndex = 23
Top = 240
Width = 5295
Begin VB.CommandButton cmdSet
Caption = "设置压缩类型见下图"
Height = 375
Left = 2040
TabIndex = 26
Top = 960
Width = 3015
End
Begin VB.CommandButton cmdScanOptions
Caption = "扫描选项..."
Height = 375
Left = 240
TabIndex = 25
Top = 960
Width = 1455
End
Begin VB.Label lblSet
Caption = "两种设置压缩类型方法:"
Height = 735
Left = 240
TabIndex = 24
Top = 240
Width = 4935
End
End
Begin VB.ComboBox cboCompressionInfo
Height = 315
Index = 5
Left = 3720
Style = 2 'Dropdown List
TabIndex = 22
Top = 5400
Width = 3975
End
Begin VB.ComboBox cboCompressionInfo
Height = 315
Index = 4
Left = 3720
Style = 2 'Dropdown List
TabIndex = 21
Top = 4920
Width = 3975
End
Begin VB.ComboBox cboCompressionInfo
Height = 315
Index = 6
Left = 3720
Style = 2 'Dropdown List
TabIndex = 20
Top = 4440
Width = 3975
End
Begin VB.ComboBox cboCompressionInfo
Height = 315
Index = 3
Left = 3720
Style = 2 'Dropdown List
TabIndex = 19
Top = 3960
Width = 3975
End
Begin VB.ComboBox cboCompressionInfo
Height = 315
Index = 2
Left = 3720
Style = 2 'Dropdown List
TabIndex = 18
Top = 3480
Width = 3975
End
Begin VB.ComboBox cboCompressionInfo
Height = 315
Index = 1
Left = 3720
Style = 2 'Dropdown List
TabIndex = 17
Top = 3000
Width = 3975
End
Begin VB.ComboBox cboCompressionType
Height = 315
Index = 5
Left = 1920
Style = 2 'Dropdown List
TabIndex = 16
Top = 5400
Width = 1575
End
Begin VB.ComboBox cboCompressionType
Height = 315
Index = 4
Left = 1920
Style = 2 'Dropdown List
TabIndex = 15
Top = 4920
Width = 1575
End
Begin VB.ComboBox cboCompressionType
Height = 315
Index = 6
Left = 1920
Style = 2 'Dropdown List
TabIndex = 14
Top = 4440
Width = 1575
End
Begin VB.ComboBox cboCompressionType
Height = 315
Index = 3
Left = 1920
Style = 2 'Dropdown List
TabIndex = 13
Top = 3960
Width = 1575
End
Begin VB.ComboBox cboCompressionType
Height = 315
Index = 2
Left = 1920
Style = 2 'Dropdown List
TabIndex = 12
Top = 3480
Width = 1575
End
Begin VB.ComboBox cboCompressionType
Height = 315
Index = 1
Left = 1920
Style = 2 'Dropdown List
TabIndex = 11
Top = 3000
Width = 1575
End
Begin VB.ComboBox cboCompressionPreference
Height = 315
Left = 240
Style = 2 'Dropdown List
TabIndex = 10
Top = 2280
Width = 3255
End
Begin VB.CommandButton cmdClose
Caption = "关闭"
Default = -1 'True
Height = 375
Left = 8880
TabIndex = 0
Top = 2040
Width = 975
End
Begin VB.Label lblImageType
Caption = "True Color (24-bit):"
Height = 255
Index = 5
Left = 240
TabIndex = 9
Top = 5400
Width = 1455
End
Begin VB.Label lblImageType
Caption = "256 Colors:"
Height = 255
Index = 4
Left = 240
TabIndex = 8
Top = 4920
Width = 1455
End
Begin VB.Label lblImageType
Caption = "16 Colors:"
Height = 255
Index = 3
Left = 240
TabIndex = 7
Top = 4440
Width = 1455
End
Begin VB.Label lblImageType
Caption = "256 Shades of Gray:"
Height = 255
Index = 2
Left = 240
TabIndex = 6
Top = 3960
Width = 1455
End
Begin VB.Label lblImageType
Caption = "16 Shades of Gray:"
Height = 255
Index = 1
Left = 240
TabIndex = 5
Top = 3480
Width = 1455
End
Begin VB.Label lblImageType
Caption = "Black and White:"
Height = 255
Index = 0
Left = 240
TabIndex = 4
Top = 3000
Width = 1455
End
Begin VB.Label lblCompressionPreference
Caption = "压缩参数"
Height = 255
Left = 240
TabIndex = 3
Top = 2040
Width = 2535
End
Begin VB.Label lblCompressionType
Caption = "Compression Type:"
Height = 255
Left = 1920
TabIndex = 2
Top = 2760
Width = 1575
End
Begin VB.Label lblCompressionInfo
Caption = "Compression Information:"
Height = 255
Left = 3720
TabIndex = 1
Top = 2760
Width = 2055
End
End
Attribute VB_Name = "frmCompress"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub GetCompressionInformation()
'**************************************************************
' PRIVATE SUB GetCompressionInformation:
'**************************************************************
'** Integers
Dim intCompressionInfo As Integer
Dim intCompressionPreference As Integer
Dim intCompressionType As Integer
Dim intIndex As Integer
On Error GoTo ShowErr
'----------------------------------------------------------
' Get the Compression Preference, and use it to set the
' ListIndex of the cboCompressionPreference combo box.
'----------------------------------------------------------
intCompressionPreference = frmMain.ImgScan1.GetCompressionPreference
cboCompressionPreference.ListIndex = intCompressionPreference
'----------------------------------------------------------
' For each of the different image types...
'----------------------------------------------------------
For intIndex = 1 To 6
'------------------------------------------------------
' Get the Compression Type, and use that to set the
' ListIndex of the cboCompressionType combo box.
'------------------------------------------------------
intCompressionType = frmMain.ImgScan1.GetPageTypeCompressionType(intIndex)
Select Case intCompressionType
Case 0 'No compression
cboCompressionType(intIndex).ListIndex = 0
Case 1 'Group 3 1D
cboCompressionType(intIndex).ListIndex = 1
Case 2 'Group 4 2D
cboCompressionType(intIndex).ListIndex = 2
Case 4 'TIFF Packbits
cboCompressionType(intIndex).ListIndex = 3
Case 8 'JPEG
cboCompressionType(intIndex).ListIndex = 4
Case 21 'LZW
cboCompressionType(intIndex).ListIndex = 5
End Select
'------------------------------------------------------
' Get the Compression Info, and use that to set the
' ListIndex of the cboCompressionInfo combo box.
'------------------------------------------------------
intCompressionInfo = frmMain.ImgScan1.GetPageTypeCompressionInfo(intIndex)
Select Case intCompressionInfo
Case 0 'No compression, or Group 3 Modified Huffman, with reversed bit order
If intCompressionType = 1 Then
cboCompressionInfo(intIndex).ListIndex = 1
Else
cboCompressionInfo(intIndex).ListIndex = 0
End If
Case 512 'Group 4 2D, with reversed bit order
cboCompressionInfo(intIndex).ListIndex = 2
Case 2304 'Group 3 1D, with reversed bit order
cboCompressionInfo(intIndex).ListIndex = 3
Case 4096 'Group 3 Modified Huffman, no reversed bit order
cboCompressionInfo(intIndex).ListIndex = 4
Case 4608 'Group 4 2D, no reversed bit order
cboCompressionInfo(intIndex).ListIndex = 5
Case 6400 'Group 3 1D, no reversed bit order
cboCompressionInfo(intIndex).ListIndex = 6
Case 3870 'JPEG low resolution, high compression
cboCompressionInfo(intIndex).ListIndex = 7
Case 7740 'JPEG low resolution, medium compression
cboCompressionInfo(intIndex).ListIndex = 8
Case 11610 'JPEG low resolution, low compression
cboCompressionInfo(intIndex).ListIndex = 9
Case 20254 'JPEG medium resolution, high compression
cboCompressionInfo(intIndex).ListIndex = 10
Case 24124 'JPEG medium resolution, medium compression
cboCompressionInfo(intIndex).ListIndex = 11
Case 27994 'JPEG medium resolution, low compression
cboCompressionInfo(intIndex).ListIndex = 12
Case -21158 'JPEG high resolution, low compression
cboCompressionInfo(intIndex).ListIndex = 13
Case -25028 'JPEG high resolution, medium compression
cboCompressionInfo(intIndex).ListIndex = 14
Case -28898 'JPEG high resolution, high compression
cboCompressionInfo(intIndex).ListIndex = 15
End Select
Next intIndex
If intCompressionPreference = 3 Then 'Custom settings
For intIndex = 1 To 6
cboCompressionType(intIndex).Enabled = True
cboCompressionInfo(intIndex).Enabled = True
Next intIndex
Else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -