J'essaye de changer la résolution du scanner sans l'intervention de l'utilisateur.
J'arrive à changer la couleur (N&b, RVB...) mais impossible sur la résolution ça reste toujours en 25 DPI.
La capture de mon soft de scan (canon)

Est ce que le code marche chez vous la résolution se met t'elle sur 300 dpi ?
Le code necessiste la DLL EZTW32.DLL que vous pouvez telechargez sur ce lien :
http://purebasic.free.fr/Purebasic/divers/EZTW32.DLL
Merci de votre aide
Code : Tout sélectionner
Procedure scan()
If OpenLibrary(1, "EZTW32.DLL")
CallFunction(1,"TWAIN_SelectImageSource",WindowID()) ; choix du scan boite de dialogue
CallFunction(1,"TWAIN_OpenDefaultSource")
;CallFunction(1,"TWAIN_SetHideUI",1) ; permet de ne pas montrer l'interface
;?
CallFunction(1,"TWAIN_SetCurrentUnits",0) ; 0= DPI
; OK
CallFunction(1,"TWAIN_SetCurrentPixelType",1) ; fonction ok Scan format 0 = B&W, 1 Grey, 2 RGB
;?
CallFunction(1,"TWAIN_SetBitDepth",24) ;Bit Depth 1, 2, 4, 8, 24 but depends on Pixeltype
;Fonctione pas reste à 25 DPI chez moi...
CallFunction(1,"TWAIN_SetCurrentResolution",300) ; en point par pouce ppp (DPI)
; le proble semble venir de cette fonction
CallFunction(1,"TWAIN_AcquireToFilename",WindowID(),"Scan.bmp")
CloseLibrary(1)
Else
MessageRequester("","Impossible d'ouvrir la dll",#MB_ICONERROR)
EndIf
EndProcedure
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 229, 97, 543, 307, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Twain")
If CreateGadgetList(WindowID())
EndIf
EndIf
EndProcedure
Open_Window_0()
scan()
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindowID() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadgetID() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_EventGadget
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;