home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{9EBAE797-FE30-11D2-8C95-00001C500B3F}#1.0#0"; "dwTwainD.ocx"
- Begin VB.Form frmTwainTest
- Caption = "Twain Control Test"
- ClientHeight = 3195
- ClientLeft = 165
- ClientTop = 1305
- ClientWidth = 4680
- Icon = "frmTwainTest.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 3195
- ScaleWidth = 4680
- StartUpPosition = 3 'Windows Default
- Begin dwTwain5Demo.TwainControl TwainControl1
- Height = 2895
- Left = 240
- Top = 60
- Width = 3075
- _ExtentX = 5424
- _ExtentY = 5106
- BorderStyle = 1
- VersionInfo = "1.0 Twain Control"
- ProductFamily = "Desaware ActiveX Controls"
- ProductName = "Desaware ActiveX Gallimaufry"
- Manufacturer = "Desaware Inc."
- End
- Begin VB.CommandButton cmdScanSelect
- Caption = "Select..."
- Height = 465
- Left = 3510
- TabIndex = 1
- Top = 90
- Width = 1005
- End
- Begin VB.CommandButton cmdCloseUI
- Caption = "Close"
- Height = 465
- Left = 3510
- TabIndex = 2
- Top = 1170
- Width = 1005
- End
- Begin VB.CommandButton cmdScan
- Caption = "Acquire..."
- Height = 465
- Left = 3510
- TabIndex = 0
- Top = 630
- Width = 1005
- End
- Begin VB.Menu mnuHelp
- Caption = "Help"
- Begin VB.Menu mnuAbout
- Caption = "About..."
- End
- Begin VB.Menu mnuOther
- Caption = "Other Products..."
- End
- End
- Attribute VB_Name = "frmTwainTest"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' TwainTest sample program
- ' Copyright
- 1999 by Desaware Inc. All Rights Reserved
- Option Explicit
- Private Sub cmdCloseUI_Click()
- TwainControl1.CloseScanner
- End Sub
- Private Sub OpenScanner(ByVal UseDefault As Boolean)
- Dim v As Variant
- Dim X As Integer
- Dim ftt As frmTwainOptions
- ManageButtons True
- ' If scanner is not already open, prompt user to select
- If TwainControl1.ControlState < 2 Then
- TwainControl1.OpenAndSelectScanner UseDefault
- End If
- ' If user cancelled the operation and didn't open the scanner
- ' Just exit.
- If TwainControl1.ControlState = 0 Then
- ManageButtons False
- Exit Sub
- End If
-
- ' If disk transfer is supported, allow user to
- ' select options
- If TwainControl1.IsDiskTransferSupported() Then
- Set ftt = New frmTwainOptions
- Set ftt.SourceControl = TwainControl1
- ftt.Show vbModal
- Set ftt = Nothing
- End If
- TwainControl1.ScanImageWithUI
- ManageButtons False
- End Sub
- Private Sub cmdScan_Click()
- OpenScanner False
- End Sub
- Private Sub ManageButtons(Disable As Boolean)
- cmdScanSelect.Enabled = Not Disable
- cmdScan.Enabled = Not Disable
- End Sub
- Private Sub cmdScanSelect_Click()
- ManageButtons True
- TwainControl1.OpenAndSelectScanner
- ManageButtons False
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- TwainControl1.CloseScanner
- End Sub
- Private Sub mnuAbout_Click()
- frmAbout.Show vbModal
- End Sub
- Private Sub mnuOther_Click()
- sdother.Show vbModal
- End Sub
- Private Sub TwainControl1_ImageScanned(ByVal PendingImages As Integer, cancelpending As Boolean)
- Call TwainControl1.SaveImageToFile("c:\temp\test.bmp")
- End Sub
-