zurück zur Startseite...
Teilbeschreibung :
Download hier : 39,20 KB
'Beispiel : Verwendung der Freeware DLL Eztw32.DLL Scanneraufruf : ' Teil 2 Private Declare Function TWAIN_AcquireToClipboard Lib "EZTW32.DLL" _ (ByVal hwndApp As Long, _ ByVal wPixTypes As Long) _ As Long Private Declare Function TWAIN_IsAvailable Lib "EZTW32.DLL" () _ As Long Private Declare Function TWAIN_EasyVersion Lib "EZTW32.DLL" () _ As Long Private Declare Function TWAIN_AcquireToFilename Lib "EZTW32.DLL" _ (ByVal hwndApp%, _ ByVal bmpFileName$) _ As Integer Private Declare Function TWAIN_SelectImageSource Lib "EZTW32.DLL" _ (ByVal hwndApp&) _ As Long Dim sPath As String Private Function fSelectScanner() TWAIN_SelectImageSource (Me.hWnd) End Function Private Function fScanImageToFile() Dim lRetVal As Long On Error GoTo ErrHandle Screen.MousePointer = 11 lRetVal = TWAIN_AcquireToFilename(Me.hWnd, sPath) If lRetVal = 0 Then Picture1.Picture = LoadPicture(sPath) Kill sPath Else GoTo ErrHandle End If Screen.MousePointer = 0 Exit Function ErrHandle: MsgBox "Scanvorgang wurde abgebrochen.", , "Error..." Screen.MousePointer = 0 End Function Private Function fScanImageToClipboard() Clipboard.Clear If TWAIN_AcquireToClipboard(Me.hWnd, nPixTypes) = 0 Then MsgBox "Es wurden keine Daten in das Clipboard gesendet.", , _ "Error..." End If End Function Private Function fGetTwainVersion() MsgBox (" (EZTW32.DLL)" + vbCrLf + _ Str(TWAIN_EasyVersion() / 100) + vbCrLf + _ "Twain - Dienst : " + _ IIf(TWAIN_IsAvailable() = 0, _ " Nicht verfuegbar.", "") + _ " Verfuegbar.") End Function Private Sub Command1_Click(Index As Integer) Select Case Index Case 0 fSelectScanner Case 1 fScanImageToFile Case 2 fScanImageToClipboard Case 3 fGetTwainVersion Case 4 Unload Me End End Select End Sub Private Sub Form_Load() sPath = App.Path & "\test.bmp" End Sub
mail
http://www.Visual-Basic5.de ( Heinz Prelle )