Scanner unter Windows 10 ansprechen

Für allgemeine Fragen zur Programmierung mit PureBasic.
Benutzeravatar
techniker
Beiträge: 160
Registriert: 27.01.2016 11:08
Wohnort: BY

Re: Scanner unter Windows 10 ansprechen

Beitrag von techniker »

Leider nützt mir das nicht viel, wenn der Scanner mit der o.g. Funktion nicht erkannt wird.. :cry:

PS: Ja, das Fujitsu-Programm funktioniert tadellos..
Never change a running system - Never run a changed system!
(PB 6.03 LTS [x86])
ccode_new
Beiträge: 1214
Registriert: 27.11.2016 18:13
Wohnort: Erzgebirge

Re: Scanner unter Windows 10 ansprechen

Beitrag von ccode_new »

techniker hat geschrieben:Leider nützt mir das nicht viel, wenn der Scanner mit der o.g. Funktion nicht erkannt wird..
Ist schon klar.

Hast du die Beispiele mit der "EZTW32.dll" aus dem englischen PB-Forum mit einer 32 bit Version von PureBasic schon probiert ?
Hierbei wäre dann aber wohl auch unbedingt auf Ascii statt UTF8 - Zeiger zu achten.

Ich denke du benötigst eine Lösung mit TWAIN.
Außer jemand hat noch andere Tipps.

Welche Dlls (TWAIN) liegen denn deiner Scannersoftware bei ?

Diese solltest du mal inspezieren. (DLL Export Viewer, etc.)
Betriebssysteme: div. Windows, Linux, Unix - Systeme

no Keyboard, press any key
no mouse, you need a cat
ccode_new
Beiträge: 1214
Registriert: 27.11.2016 18:13
Wohnort: Erzgebirge

Re: Scanner unter Windows 10 ansprechen

Beitrag von ccode_new »

Huhu!!!

Ich habe gute Nachrichten. :mrgreen:

Das hier habe ich gefunden: (Bei mir funktioniert es! (32 bit) )

http://purebasic.info/phpBB3ex/download ... 44d36d6559

(Im russischen PureBasic-Forum :mrgreen: )

http://purebasic.info/phpBB3ex/viewtopic.php?f=5&t=4179
Betriebssysteme: div. Windows, Linux, Unix - Systeme

no Keyboard, press any key
no mouse, you need a cat
Benutzeravatar
techniker
Beiträge: 160
Registriert: 27.01.2016 11:08
Wohnort: BY

Re: Scanner unter Windows 10 ansprechen

Beitrag von techniker »

Ja, damit funktioniert es schon mal grundsätzlich. 8)

Die nächsten Fragen:
- Wie kann ich die Datenquelle automatisch auswählen? (Also ohne Dialog)
- Wie kann ich direkt den Scan-Vorgang starten? (Aktuell kommt noch ein Dialog der Scanner-Software)

Bzw. gibt es irgendwo eine gute Beschreibung der Twain32d.dll?

Danke! :allright:
Never change a running system - Never run a changed system!
(PB 6.03 LTS [x86])
Benutzeravatar
techniker
Beiträge: 160
Registriert: 27.01.2016 11:08
Wohnort: BY

Re: Scanner unter Windows 10 ansprechen

Beitrag von techniker »

techniker hat geschrieben: Bzw. gibt es irgendwo eine gute Beschreibung der Twain32d.dll?
http://www.eztwain.com/pub/eztp/EZTwain_User_Guide.pdf :mrgreen:
Never change a running system - Never run a changed system!
(PB 6.03 LTS [x86])
Benutzeravatar
techniker
Beiträge: 160
Registriert: 27.01.2016 11:08
Wohnort: BY

Re: Scanner unter Windows 10 ansprechen

Beitrag von techniker »

3 grobe Probleme bleiben aber:

- Wie parametriere ich einen Duplex-Scan?
- Wie weise ich eine Scanquelle explizit (z.B. über Name) ohne Dialog zu?
- Liegen mehrere Seiten im Scanner werden zwar alle durchgezogen, aber nur das erste Blatt gescannt
Zuletzt geändert von techniker am 21.11.2019 17:15, insgesamt 1-mal geändert.
Never change a running system - Never run a changed system!
(PB 6.03 LTS [x86])
Benutzeravatar
techniker
Beiträge: 160
Registriert: 27.01.2016 11:08
Wohnort: BY

Re: Scanner unter Windows 10 ansprechen

Beitrag von techniker »

TWAIN32d.pb

Code: Alles auswählen

; Twain states
#TWAIN_PRESESSION     = 1 ; Source Manager Not loaded
#TWAIN_SM_LOADED      = 2 ; Source Manager loaded
#TWAIN_SM_OPEN        = 3 ; Source Manager open
#TWAIN_SOURCE_OPEN    = 4 ; Source open For negotiation
#TWAIN_SOURCE_ENABLED = 5 ; Source enabled To acquire
#TWAIN_TRANSFER_READY = 6 ; Image ready To transfer
#TWAIN_TRANSFERRING   = 7 ; Image in transit

; Unit code
#TWUN_INCHES      = 0
#TWUN_CENTIMETERS = 1
#TWUN_PICAS       = 2
#TWUN_POINTS      = 3
#TWUN_TWIPS       = 4
#TWUN_PIXELS      = 5

; Pixel type
#TWPT_BW        = 0 ; 1-bit per pixel, black And white
#TWPT_GRAY      = 1 ; grayscale, 8 Or 4-bit
#TWPT_RGB       = 2 ; RGB color, 24-bit (rarely, 15,16,32-bit)
#TWPT_PALETTE   = 3 ; indexed color (image has a color table) 8 Or 4-bit.
#TWPT_CMY       = 4 ; CMY color, 24-bit
#TWPT_CMYK      = 5 ; CMYK color, 32-bit
#TWAIN_BW       = 1 ; 1-bit per pixel, B&W (== TWPT_BW)
#TWAIN_GRAY     = 2 ; 1, 4 Or 8-bit grayscale (== TWPT_GRAY)
#TWAIN_RGB      = 4 ; 24-bit RGB color (== TWPT_RGB)
#TWAIN_PALETTE  = 8 ; 1, 4 Or 8-bit palette (== TWPT_PALETTE) hImage.l
#TWAIN_ANYTYPE  = 0 ; any of the above


Macro CheckFunctionPointer(pointer, name)
  If Not pointer : Debug" Error: Functionpointer of '" + name + "' in 'TWAIN32d.dll' is Zero ! " : CloseLibrary(DLL) : CallDebugger : EndIf
EndMacro

; Prototype declaration
Prototype.l __DllMain() : Global DllMain.__DllMain
Prototype.l __TWAIN_AbortAllPendingXfers() : Global TWAIN_AbortAllPendingXfers.__TWAIN_AbortAllPendingXfers
Prototype.l __TWAIN_AcquireNative(hwnd.i, wPixTypes.i) : Global TWAIN_AcquireNative.__TWAIN_AcquireNative
Prototype.l __TWAIN_AcquireToClipboard(hwndApp.i, wPixTypes.i) : Global TWAIN_AcquireToClipboard.__TWAIN_AcquireToClipboard
Prototype.l __TWAIN_AcquireToFilename(hwnd.i, pszFile.s) : Global TWAIN_AcquireToFilename.__TWAIN_AcquireToFilename
Prototype.l __TWAIN_BreakModalLoop() : Global TWAIN_BreakModalLoop.__TWAIN_BreakModalLoop
Prototype.l __TWAIN_CloseSource() : Global TWAIN_CloseSource.__TWAIN_CloseSource
Prototype.l __TWAIN_CloseSourceManager() : Global TWAIN_CloseSourceManager.__TWAIN_CloseSourceManager
Prototype.l __TWAIN_CreateDibPalette() : Global TWAIN_CreateDibPalette.__TWAIN_CreateDibPalette
Prototype.l __TWAIN_DS() : Global TWAIN_DS.__TWAIN_DS
Prototype.l __TWAIN_DibDepth(hdib.i) : Global TWAIN_DibDepth.__TWAIN_DibDepth
Prototype.l __TWAIN_DibHeight(hdib.i) : Global TWAIN_DibHeight.__TWAIN_DibHeight
Prototype.l __TWAIN_DibNumColors(hdib.i) : Global TWAIN_DibNumColors.__TWAIN_DibNumColors
Prototype.l __TWAIN_DibWidth(hdib.i) : Global TWAIN_DibWidth.__TWAIN_DibWidth
Prototype.l __TWAIN_DisableSource() : Global TWAIN_DisableSource.__TWAIN_DisableSource
Prototype.l __TWAIN_DrawDibToDC() : Global TWAIN_DrawDibToDC.__TWAIN_DrawDibToDC
Prototype.l __TWAIN_EasyVersion() : Global TWAIN_EasyVersion.__TWAIN_EasyVersion
Prototype.l __TWAIN_EnableSource(hwnd.i) : Global TWAIN_EnableSource.__TWAIN_EnableSource
Prototype.l __TWAIN_EndXfer() : Global TWAIN_EndXfer.__TWAIN_EndXfer
Prototype.l __TWAIN_ErrorBox() : Global TWAIN_ErrorBox.__TWAIN_ErrorBox
Prototype.l __TWAIN_Fix32ToFloat() : Global TWAIN_Fix32ToFloat.__TWAIN_Fix32ToFloat
Prototype.l __TWAIN_FreeNative(hdib.i) : Global TWAIN_FreeNative.__TWAIN_FreeNative
Prototype.l __TWAIN_GetBitDepth() : Global TWAIN_GetBitDepth.__TWAIN_GetBitDepth
Prototype.l __TWAIN_GetCapCurrent() : Global TWAIN_GetCapCurrent.__TWAIN_GetCapCurrent
Prototype.l __TWAIN_GetConditionCode() : Global TWAIN_GetConditionCode.__TWAIN_GetConditionCode
Prototype.l __TWAIN_GetCurrentResolution() : Global TWAIN_GetCurrentResolution.__TWAIN_GetCurrentResolution
Prototype.l __TWAIN_GetCurrentUnits() : Global TWAIN_GetCurrentUnits.__TWAIN_GetCurrentUnits
Prototype.l __TWAIN_GetHideUI() : Global TWAIN_GetHideUI.__TWAIN_GetHideUI
Prototype.l __TWAIN_GetPixelType() : Global TWAIN_GetPixelType.__TWAIN_GetPixelType
Prototype.l __TWAIN_GetResultCode() : Global TWAIN_GetResultCode.__TWAIN_GetResultCode
Prototype.l __TWAIN_GetYResolution() : Global TWAIN_GetYResolution.__TWAIN_GetYResolution
Prototype.l __TWAIN_IsAvailable() : Global TWAIN_IsAvailable.__TWAIN_IsAvailable
Prototype.l __TWAIN_LoadNativeFromFile() : Global TWAIN_LoadNativeFromFile.__TWAIN_LoadNativeFromFile
Prototype.l __TWAIN_LoadNativeFromFilename(file.s) : Global TWAIN_LoadNativeFromFilename.__TWAIN_LoadNativeFromFilename
Prototype.l __TWAIN_LoadSourceManager() : Global TWAIN_LoadSourceManager.__TWAIN_LoadSourceManager
Prototype.l __TWAIN_MessageHook() : Global TWAIN_MessageHook.__TWAIN_MessageHook
Prototype.l __TWAIN_Mgr() : Global TWAIN_Mgr.__TWAIN_Mgr
Prototype.l __TWAIN_ModalEventLoop() : Global TWAIN_ModalEventLoop.__TWAIN_ModalEventLoop
Prototype.l __TWAIN_NegotiatePixelTypes() : Global TWAIN_NegotiatePixelTypes.__TWAIN_NegotiatePixelTypes
Prototype.l __TWAIN_NegotiateXferCount() : Global TWAIN_NegotiateXferCount.__TWAIN_NegotiateXferCount
Prototype.l __TWAIN_OpenDefaultSource() : Global TWAIN_OpenDefaultSource.__TWAIN_OpenDefaultSource
Prototype.l __TWAIN_OpenSourceManager(hwnd.i) : Global TWAIN_OpenSourceManager.__TWAIN_OpenSourceManager
Prototype.l __TWAIN_RegisterApp() : Global TWAIN_RegisterApp.__TWAIN_RegisterApp
Prototype.l __TWAIN_ReportLastError() : Global TWAIN_ReportLastError.__TWAIN_ReportLastError
Prototype.l __TWAIN_SelectImageSource(hwnd.i) : Global TWAIN_SelectImageSource.__TWAIN_SelectImageSource
Prototype.l __TWAIN_SetBitDepth(nBits.i) : Global TWAIN_SetBitDepth.__TWAIN_SetBitDepth
Prototype.l __TWAIN_SetBrightness(dBri.d) : Global TWAIN_SetBrightness.__TWAIN_SetBrightness
Prototype.l __TWAIN_SetCapOneValue() : Global TWAIN_SetCapOneValue.__TWAIN_SetCapOneValue
Prototype.l __TWAIN_SetContrast(dCon.d) : Global TWAIN_SetContrast.__TWAIN_SetContrast
Prototype.l __TWAIN_SetCurrentPixelType(nPixType.i) : Global TWAIN_SetCurrentPixelType.__TWAIN_SetCurrentPixelType
Prototype.l __TWAIN_SetCurrentResolution(dRes.d) : Global TWAIN_SetCurrentResolution.__TWAIN_SetCurrentResolution
Prototype.l __TWAIN_SetCurrentUnits(nUnits.i) : Global TWAIN_SetCurrentUnits.__TWAIN_SetCurrentUnits
Prototype.l __TWAIN_SetHideUI(fHide.i) : Global TWAIN_SetHideUI.__TWAIN_SetHideUI
Prototype.l __TWAIN_SetXferMech(nXfers.i) : Global TWAIN_SetXferMech.__TWAIN_SetXferMech
Prototype.l __TWAIN_State() : Global TWAIN_State.__TWAIN_State
Prototype.l __TWAIN_ToFix32() : Global TWAIN_ToFix32.__TWAIN_ToFix32
Prototype.l __TWAIN_UnloadSourceManager() : Global TWAIN_UnloadSourceManager.__TWAIN_UnloadSourceManager
Prototype.l __TWAIN_WaitForNativeXfer() : Global TWAIN_WaitForNativeXfer.__TWAIN_WaitForNativeXfer
Prototype.l __TWAIN_WriteDibToFile(hdib.i, file.s) : Global TWAIN_WriteDibToFile.__TWAIN_WriteDibToFile
Prototype.l __TWAIN_WriteNativeToFile() : Global TWAIN_WriteNativeToFile.__TWAIN_WriteNativeToFile
Prototype.l __TWAIN_WriteNativeToFilename(hdib.i, file.s) : Global TWAIN_WriteNativeToFilename.__TWAIN_WriteNativeToFilename
Prototype.l __TWAIN_XferMech() : Global TWAIN_XferMech.__TWAIN_XferMech

; Init-Funktion
Procedure TWAIN32d_Init()
  Shared DLL.l
  
  DLL = OpenLibrary(#PB_Any,"TWAIN32d.dll")
  
  If DLL
    DllMain = GetFunction(DLL, "DllMain") : CheckFunctionPointer(DllMain, "DllMain")
    TWAIN_AbortAllPendingXfers = GetFunction(DLL, "TWAIN_AbortAllPendingXfers") : CheckFunctionPointer(TWAIN_AbortAllPendingXfers, "TWAIN_AbortAllPendingXfers")
    TWAIN_AcquireNative = GetFunction(DLL, "TWAIN_AcquireNative") : CheckFunctionPointer(TWAIN_AcquireNative, "TWAIN_AcquireNative")
    TWAIN_AcquireToClipboard = GetFunction(DLL, "TWAIN_AcquireToClipboard") : CheckFunctionPointer(TWAIN_AcquireToClipboard, "TWAIN_AcquireToClipboard")
    TWAIN_AcquireToFilename = GetFunction(DLL, "TWAIN_AcquireToFilename") : CheckFunctionPointer(TWAIN_AcquireToFilename, "TWAIN_AcquireToFilename")
    TWAIN_BreakModalLoop = GetFunction(DLL, "TWAIN_BreakModalLoop") : CheckFunctionPointer(TWAIN_BreakModalLoop, "TWAIN_BreakModalLoop")
    TWAIN_CloseSource = GetFunction(DLL, "TWAIN_CloseSource") : CheckFunctionPointer(TWAIN_CloseSource, "TWAIN_CloseSource")
    TWAIN_CloseSourceManager = GetFunction(DLL, "TWAIN_CloseSourceManager") : CheckFunctionPointer(TWAIN_CloseSourceManager, "TWAIN_CloseSourceManager")
    TWAIN_CreateDibPalette = GetFunction(DLL, "TWAIN_CreateDibPalette") : CheckFunctionPointer(TWAIN_CreateDibPalette, "TWAIN_CreateDibPalette")
    TWAIN_DS = GetFunction(DLL, "TWAIN_DS") : CheckFunctionPointer(TWAIN_DS, "TWAIN_DS")
    TWAIN_DibDepth = GetFunction(DLL, "TWAIN_DibDepth") : CheckFunctionPointer(TWAIN_DibDepth, "TWAIN_DibDepth")
    TWAIN_DibHeight = GetFunction(DLL, "TWAIN_DibHeight") : CheckFunctionPointer(TWAIN_DibHeight, "TWAIN_DibHeight")
    TWAIN_DibNumColors = GetFunction(DLL, "TWAIN_DibNumColors") : CheckFunctionPointer(TWAIN_DibNumColors, "TWAIN_DibNumColors")
    TWAIN_DibWidth = GetFunction(DLL, "TWAIN_DibWidth") : CheckFunctionPointer(TWAIN_DibWidth, "TWAIN_DibWidth")
    TWAIN_DisableSource = GetFunction(DLL, "TWAIN_DisableSource") : CheckFunctionPointer(TWAIN_DisableSource, "TWAIN_DisableSource")
    TWAIN_DrawDibToDC = GetFunction(DLL, "TWAIN_DrawDibToDC") : CheckFunctionPointer(TWAIN_DrawDibToDC, "TWAIN_DrawDibToDC")
    TWAIN_EasyVersion = GetFunction(DLL, "TWAIN_EasyVersion") : CheckFunctionPointer(TWAIN_EasyVersion, "TWAIN_EasyVersion")
    TWAIN_EnableSource = GetFunction(DLL, "TWAIN_EnableSource") : CheckFunctionPointer(TWAIN_EnableSource, "TWAIN_EnableSource")
    TWAIN_EndXfer = GetFunction(DLL, "TWAIN_EndXfer") : CheckFunctionPointer(TWAIN_EndXfer, "TWAIN_EndXfer")
    TWAIN_ErrorBox = GetFunction(DLL, "TWAIN_ErrorBox") : CheckFunctionPointer(TWAIN_ErrorBox, "TWAIN_ErrorBox")
    TWAIN_Fix32ToFloat = GetFunction(DLL, "TWAIN_Fix32ToFloat") : CheckFunctionPointer(TWAIN_Fix32ToFloat, "TWAIN_Fix32ToFloat")
    TWAIN_FreeNative = GetFunction(DLL, "TWAIN_FreeNative") : CheckFunctionPointer(TWAIN_FreeNative, "TWAIN_FreeNative")
    TWAIN_GetBitDepth = GetFunction(DLL, "TWAIN_GetBitDepth") : CheckFunctionPointer(TWAIN_GetBitDepth, "TWAIN_GetBitDepth")
    TWAIN_GetCapCurrent = GetFunction(DLL, "TWAIN_GetCapCurrent") : CheckFunctionPointer(TWAIN_GetCapCurrent, "TWAIN_GetCapCurrent")
    TWAIN_GetConditionCode = GetFunction(DLL, "TWAIN_GetConditionCode") : CheckFunctionPointer(TWAIN_GetConditionCode, "TWAIN_GetConditionCode")
    TWAIN_GetCurrentResolution = GetFunction(DLL, "TWAIN_GetCurrentResolution") : CheckFunctionPointer(TWAIN_GetCurrentResolution, "TWAIN_GetCurrentResolution")
    TWAIN_GetCurrentUnits = GetFunction(DLL, "TWAIN_GetCurrentUnits") : CheckFunctionPointer(TWAIN_GetCurrentUnits, "TWAIN_GetCurrentUnits")
    TWAIN_GetHideUI = GetFunction(DLL, "TWAIN_GetHideUI") : CheckFunctionPointer(TWAIN_GetHideUI, "TWAIN_GetHideUI")
    TWAIN_GetPixelType = GetFunction(DLL, "TWAIN_GetPixelType") : CheckFunctionPointer(TWAIN_GetPixelType, "TWAIN_GetPixelType")
    TWAIN_GetResultCode = GetFunction(DLL, "TWAIN_GetResultCode") : CheckFunctionPointer(TWAIN_GetResultCode, "TWAIN_GetResultCode")
    TWAIN_GetYResolution = GetFunction(DLL, "TWAIN_GetYResolution") : CheckFunctionPointer(TWAIN_GetYResolution, "TWAIN_GetYResolution")
    TWAIN_IsAvailable = GetFunction(DLL, "TWAIN_IsAvailable") : CheckFunctionPointer(TWAIN_IsAvailable, "TWAIN_IsAvailable")
    TWAIN_LoadNativeFromFile = GetFunction(DLL, "TWAIN_LoadNativeFromFile") : CheckFunctionPointer(TWAIN_LoadNativeFromFile, "TWAIN_LoadNativeFromFile")
    TWAIN_LoadNativeFromFilename = GetFunction(DLL, "TWAIN_LoadNativeFromFilename") : CheckFunctionPointer(TWAIN_LoadNativeFromFilename, "TWAIN_LoadNativeFromFilename")
    TWAIN_LoadSourceManager = GetFunction(DLL, "TWAIN_LoadSourceManager") : CheckFunctionPointer(TWAIN_LoadSourceManager, "TWAIN_LoadSourceManager")
    TWAIN_MessageHook = GetFunction(DLL, "TWAIN_MessageHook") : CheckFunctionPointer(TWAIN_MessageHook, "TWAIN_MessageHook")
    TWAIN_Mgr = GetFunction(DLL, "TWAIN_Mgr") : CheckFunctionPointer(TWAIN_Mgr, "TWAIN_Mgr")
    TWAIN_ModalEventLoop = GetFunction(DLL, "TWAIN_ModalEventLoop") : CheckFunctionPointer(TWAIN_ModalEventLoop, "TWAIN_ModalEventLoop")
    TWAIN_NegotiatePixelTypes = GetFunction(DLL, "TWAIN_NegotiatePixelTypes") : CheckFunctionPointer(TWAIN_NegotiatePixelTypes, "TWAIN_NegotiatePixelTypes")
    TWAIN_NegotiateXferCount = GetFunction(DLL, "TWAIN_NegotiateXferCount") : CheckFunctionPointer(TWAIN_NegotiateXferCount, "TWAIN_NegotiateXferCount")
    TWAIN_OpenDefaultSource = GetFunction(DLL, "TWAIN_OpenDefaultSource") : CheckFunctionPointer(TWAIN_OpenDefaultSource, "TWAIN_OpenDefaultSource")
    TWAIN_OpenSourceManager = GetFunction(DLL, "TWAIN_OpenSourceManager") : CheckFunctionPointer(TWAIN_OpenSourceManager, "TWAIN_OpenSourceManager")
    TWAIN_RegisterApp = GetFunction(DLL, "TWAIN_RegisterApp") : CheckFunctionPointer(TWAIN_RegisterApp, "TWAIN_RegisterApp")
    TWAIN_ReportLastError = GetFunction(DLL, "TWAIN_ReportLastError") : CheckFunctionPointer(TWAIN_ReportLastError, "TWAIN_ReportLastError")
    TWAIN_SelectImageSource = GetFunction(DLL, "TWAIN_SelectImageSource") : CheckFunctionPointer(TWAIN_SelectImageSource, "TWAIN_SelectImageSource")
    TWAIN_SetBitDepth = GetFunction(DLL, "TWAIN_SetBitDepth") : CheckFunctionPointer(TWAIN_SetBitDepth, "TWAIN_SetBitDepth")
    TWAIN_SetBrightness = GetFunction(DLL, "TWAIN_SetBrightness") : CheckFunctionPointer(TWAIN_SetBrightness, "TWAIN_SetBrightness")
    TWAIN_SetCapOneValue = GetFunction(DLL, "TWAIN_SetCapOneValue") : CheckFunctionPointer(TWAIN_SetCapOneValue, "TWAIN_SetCapOneValue")
    TWAIN_SetContrast = GetFunction(DLL, "TWAIN_SetContrast") : CheckFunctionPointer(TWAIN_SetContrast, "TWAIN_SetContrast")
    TWAIN_SetCurrentPixelType = GetFunction(DLL, "TWAIN_SetCurrentPixelType") : CheckFunctionPointer(TWAIN_SetCurrentPixelType, "TWAIN_SetCurrentPixelType")
    TWAIN_SetCurrentResolution = GetFunction(DLL, "TWAIN_SetCurrentResolution") : CheckFunctionPointer(TWAIN_SetCurrentResolution, "TWAIN_SetCurrentResolution")
    TWAIN_SetCurrentUnits = GetFunction(DLL, "TWAIN_SetCurrentUnits") : CheckFunctionPointer(TWAIN_SetCurrentUnits, "TWAIN_SetCurrentUnits")
    TWAIN_SetHideUI = GetFunction(DLL, "TWAIN_SetHideUI") : CheckFunctionPointer(TWAIN_SetHideUI, "TWAIN_SetHideUI")
    TWAIN_SetXferMech = GetFunction(DLL, "TWAIN_SetXferMech") : CheckFunctionPointer(TWAIN_SetXferMech, "TWAIN_SetXferMech")
    TWAIN_State = GetFunction(DLL, "TWAIN_State") : CheckFunctionPointer(TWAIN_State, "TWAIN_State")
    TWAIN_ToFix32 = GetFunction(DLL, "TWAIN_ToFix32") : CheckFunctionPointer(TWAIN_ToFix32, "TWAIN_ToFix32")
    TWAIN_UnloadSourceManager = GetFunction(DLL, "TWAIN_UnloadSourceManager") : CheckFunctionPointer(TWAIN_UnloadSourceManager, "TWAIN_UnloadSourceManager")
    TWAIN_WaitForNativeXfer = GetFunction(DLL, "TWAIN_WaitForNativeXfer") : CheckFunctionPointer(TWAIN_WaitForNativeXfer, "TWAIN_WaitForNativeXfer")
    TWAIN_WriteDibToFile = GetFunction(DLL, "TWAIN_WriteDibToFile") : CheckFunctionPointer(TWAIN_WriteDibToFile, "TWAIN_WriteDibToFile")
    TWAIN_WriteNativeToFile = GetFunction(DLL, "TWAIN_WriteNativeToFile") : CheckFunctionPointer(TWAIN_WriteNativeToFile, "TWAIN_WriteNativeToFile")
    TWAIN_WriteNativeToFilename = GetFunction(DLL, "TWAIN_WriteNativeToFilename") : CheckFunctionPointer(TWAIN_WriteNativeToFilename, "TWAIN_WriteNativeToFilename")
    TWAIN_XferMech = GetFunction(DLL, "TWAIN_XferMech") : CheckFunctionPointer(TWAIN_XferMech, "TWAIN_XferMech")
  EndIf
EndProcedure

; End-Funktion
Procedure TWAIN32d_Free()
  Shared DLL.l
  
  CloseLibrary(DLL)
EndProcedure
example.pb

Code: Alles auswählen

IncludeFile "TWAIN32d.pb"

TWAIN32d_Init()

;picpath.s  = "scanned.bmp"

hWnd  = OpenWindow(0, 0, 0, 767, 476, "Scan", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
If hWnd
  
  If TWAIN_IsAvailable()
    Debug TWAIN_SetHideUI(#True)
    Debug TWAIN_OpenDefaultSource()
    Debug TWAIN_SetCurrentPixelType(#TWPT_RGB)
    Debug TWAIN_SetBitDepth(8)
    Debug TWAIN_SetCurrentResolution(600.0)
    
    Debug TWAIN_AcquireToClipboard(hWnd, #TWAIN_ANYTYPE)
    ;Debug  TWAIN_AcquireToFilename(hWnd, picpath)
    
  EndIf
  
EndIf

TWAIN32d_Free()
Never change a running system - Never run a changed system!
(PB 6.03 LTS [x86])
ccode_new
Beiträge: 1214
Registriert: 27.11.2016 18:13
Wohnort: Erzgebirge

Re: Scanner unter Windows 10 ansprechen

Beitrag von ccode_new »

Hallo!

Hast du deine 3 Fragen schon selber beantworten können? (lösen)

Für Linux-Nutzer habe ich das hier gefunden:

https://www.purebasic.fr/english/viewto ... 8&start=15

Wenn der Autor: Kukulkan
das hier liest möchte ich nur sagen:

"Ich finde das gaaanz supi!"
Betriebssysteme: div. Windows, Linux, Unix - Systeme

no Keyboard, press any key
no mouse, you need a cat
Benutzeravatar
techniker
Beiträge: 160
Registriert: 27.01.2016 11:08
Wohnort: BY

Re: Scanner unter Windows 10 ansprechen

Beitrag von techniker »

ccode_new hat geschrieben: Hast du deine 3 Fragen schon selber beantworten können? (lösen)
Leider nein.. :cry:

Ich kann mich erst nächste Woche weiter damit beschäftigen.
Wie dein Tipp auch, bin ich auch gerade am suchen nach Kommandozeilen-Tools wie NAPS2..

Eine DLL hätte mir besser gefallen - aber das Ergebnis zählt nun mal. :wink:
Never change a running system - Never run a changed system!
(PB 6.03 LTS [x86])
Antworten