Visual Basic, .NET, ASP, VBScript
 

   
   
     

Форум - Работа с данными

Страница: 1 |

 

  Вопрос: Как получить данные со сканера? Добавлено: 05.12.08 22:28  

Автор вопроса:  Lion | Web-сайт: lammeru.net | ICQ: 367220539 
Доброго времени суток! Выручайте.... Как получить данные со сканера? в VB6

Ответить

  Ответы Всего ответов: 9  

Номер ответа: 1
Автор ответа:
 Arseny



ICQ: 298826769 

Вопросов: 53
Ответов: 1732
 Профиль | | #1 Добавлено: 05.12.08 23:31
http://www.google.com/search?ie=UTF-8&hl=ru&q=twain%20vb6

Ответить

Номер ответа: 2
Автор ответа:
 Фeнягz



Вопросов: 2
Ответов: 62
 Web-сайт: atauenis.narod.ru
 Профиль | | #2
Добавлено: 06.12.08 01:54
  1. '
  2. '  eztwain.bas
  3. '
  4. '  translated from
  5. '  EZTWAIN.H - interface to Easy TWAIN library from www.dosadi.com
  6. '  by Don Dickinson
  7. '  ddickinson@usinternet.com
  8. '  dickinson.basicguru.com
  9. '
  10. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. '  BELOW ARE THE HEADER NOTES FROM EZTWAIN.H
  12. '
  13. '
  14. '  1.13     09/08/99 Documented correct return codes of AcquireToFilename.
  15. '                    - No code changes -
  16. '  1.12     09/14/98 Added Fix32ToFloat, allow MSG_OPENDS triplet.
  17. '                    Added SetXferMech, XferMech.
  18. '  1.11     08/17/98 Added ToFix32, SetContrast, SetBrightness.
  19. '                    Modified TWAIN_ToFix32 to round away-from-zero.
  20. '  1.09beta 07/27/98 Reverted from 1.08 to 1.06 and worked forward again.
  21. '  1.06     08/21/97 correction to message hook, fixed 32-bit exports
  22. '  1.05     11/06/96 32-bit conversion
  23. '  1.04     05/03/95 added: WriteNativeToFile, WriteNativeToFilename,
  24. '       FreeNative, SetHideUI, GetHideUI, SetCurrentUnits,
  25. '       GetCurrentUnits, SetCurrentResolution, SetBitDepth,
  26. '       SetCurrentPixelType, SetCapOneValue.
  27. '  1.0a     06/23/94 first alpha version
  28. '  0.0      05/11/94 created
  29. '
  30. '  EZTWAIN 1.x is not a product, and is not the work of any company involved
  31. '  in promoting or using the TWAIN standard.  This code is sample code,
  32. '  provided without charge, and you use it entirely at your own risk.
  33. '  No rights or ownership is claimed by the author, or by any company
  34. '  or organization.  There are no restrictions on use or (re)distribution.
  35. '
  36. ' Download from:    www.dosadi.com
  37. '
  38. ' Support contact:  support@dosadi.com
  39. '
  40. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. '
  42. #if not %def(%EZTWAIN_BAS)
  43. %EZTWAIN_BAS = 1
  44. #include "win32api.inc"
  45. Declare Function TWAIN_AcquireNative Lib "EZTW32.DLL" Alias "TWAIN_AcquireNative" _
  46.       ( ByVal hwndApp as Long, ByVal wPizTypes as DWord ) as Long
  47. '
  48. '  The minimal use of EZTWAIN.DLL is to just call this routine, with 0 for
  49. '  both params.  EZTWAIN creates a window if hwndApp is 0.
  50. '
  51. '  Acquires a single image, from the currently selected Data Source, using
  52. '  Native-mode transfer. It waits until the source closes (if it's modal) or
  53. '  forces the source closed if not.  The return value is a handle to the
  54. '  acquired image.  Only one image can be acquired per call.
  55. '
  56. '  Under Windows, the return value is a global memory handle - applying
  57. '  GlobalLock to it will return a (huge) pointer to the DIB, which
  58. '  starts with a BITMAPINFOHEADER.
  59. '  NOTE: You are responsible for disposing of the returned DIB - these things
  60. '  can eat up your Windows memory fast!  See TWAIN_FreeNative below.
  61. '
  62. '  The image type can be restricted using the following masks.  A mask of 0
  63. '  means 'any pixel type is welcome'.
  64. '  Caution: You should not assume that the source will honor a pixel type
  65. '  restriction!  If you care, check the parameters of the DIB.
  66. '
  67. %TWAIN_BW = &h0001 '  1-bit per pixel, B&W (== TWPT_BW)
  68. %TWAIN_GRAY = &h0002 '  1,4, or 8-bit grayscale  (== TWPT_GRAY)
  69. %TWAIN_RGB = &h0004 '  24-bit RGB color         (== TWPT_RGB)
  70. %TWAIN_PALETTE = &h0008 '  1,4, or 8-bit palette    (== TWPT_PALETTE)
  71. %TWAIN_ANYTYPE = &h0000 '  any of the above
  72. Declare Sub TWAIN_FreeNative Lib "EZTW32.DLL" Alias "TWAIN_FreeNative" ( ByVal hdib as Long )
  73. '
  74. '  Release the memory allocated to a native format image, as returned by
  75. '  TWAIN_AcquireNative. (If you are coding in C or C++, this is just a call
  76. '  to GlobalFree.)
  77. '  If you use TWAIN_AcquireNative and don't free the returned image handle,
  78. '  it stays around taking up Windows (virtual) memory until your application
  79. '  terminates.  Memory required per square inch:
  80. '              1 bit B&W       8-bit grayscale     24-bit color
  81. '  100 dpi      1.25KB              10KB               30KB
  82. '  200 dpi        5KB               40KB              120KB
  83. '  300 dpi      11.25KB             90KB              270KB
  84. '  400 dpi       20KB              160KB              480KB
  85. '
  86. Declare Function TWAIN_AcquireToClipboard Lib "EZTW32.DLL" Alias "TWAIN_AcquireToClipboard" _
  87.       ( ByVal hwndApp as Long, ByVal wPixTypes as Dword ) as Long
  88. '
  89. '  Like AcquireNative, but puts the resulting image, if any, into the system
  90. '  clipboard.  Under Windows, this will put a CF_DIB item in the clipboard
  91. '  if successful.  If this call fails, the clipboard is either empty or
  92. '  contains the old contents.
  93. '  A return value of 1 indicates success, 0 indicates failure.
  94. '
  95. '  Useful for environments like Visual Basic where it is hard to make direct
  96. '  use of a DIB handle.  In fact, TWAIN_AcquireToClipboard uses
  97. '  TWAIN_AcquireNative for all the hard work.
  98. '
  99. Declare Function TWAIN_AcquireToFilename Lib "EZTW32.DLL" Alias "TWAIN_AcquireToFilename" _
  100.       ( ByVal hwndApp as Long, zFile as Asciiz ) as Long
  101. '
  102. '  Acquire an image and write it to a .BMP (Windows Bitmap) file.
  103. '  The file name and path in pszFile are used.  If pszFile is NULL or
  104. '  points to an empty string, the user is prompted with a Save File dialog.
  105. '  Return values:
  106. '  0 success
  107. '  -1 Acquire failed OR user cancelled File Save dialog
  108. '  -2 file open error (invalid path or name, or access denied)
  109. '  -3 (weird) unable to lock DIB - probably an invalid handle.
  110. '  -4 writing BMP data failed, possibly output device is full
  111. '
  112. Declare Function TWAIN_SelectImageSource Lib "EZTW32.DLL" Alias "TWAIN_SelectImageSource" _
  113.       ( ByVal hwnd as Long ) as Long
  114. '
  115. '  This is the routine to call when the user chooses the "Select Source..."
  116. '  menu command from your application's File menu.  Your app has one of
  117. '  these, right?  The TWAIN spec calls for this feature to be available in
  118. '  your user interface, preferably as described.
  119. '  Note: If only one TWAIN device is installed on a system, it is selected
  120. '  automatically, so there is no need for the user to do Select Source.
  121. '  You should not require your users to do Select Source before Acquire.
  122. '
  123. '  This function posts the Source Manager's Select Source dialog box.
  124. '  It returns after the user either OK's or CANCEL's that dialog.
  125. '  A return of 1 indicates OK, 0 indicates one of the following:
  126. '    a) The user cancelled the dialog
  127. '    b) The Source Manager found no data sources installed
  128. '    c) There was a failure before the Select Source dialog could be posted
  129. '  -- details --
  130. '  Only sources that can return images (that are in the DG_IMAGE group) are
  131. '  displayed.  The current default source will be highlighted initially.
  132. '  In the standard implementation of "Select Source...", your application
  133. '  doesn't need to do anything except make this one call.
  134. '
  135. '  If you want to be meticulous, disable your "Acquire" and "Select Source"
  136. '  menu items or buttons if TWAIN_IsAvailable() returns 0 - see below.
  137. '
  138. ' --------- Basic TWAIN Inquiries
  139. Declare Function TWAIN_IsAvailable Lib "EZTW32.DLL" Alias "TWAIN_IsAvailable" () as Long
  140. '
  141. '  Call this function any time to find out if TWAIN is installed on the
  142. '  system.  It takes a little time on the first call, after that it's fast,
  143. '  just testing a flag.  It returns 1 if the TWAIN Source Manager is
  144. '  installed & can be loaded, 0 otherwise.
  145. '
  146. Declare Function TWAIN_EasyVersion Lib "EZTW32.DLL" Alias "TWAIN_EasyVersion" () as Long
  147. '
  148. '  Returns the version number of EZTWAIN.DLL, multiplied by 100.
  149. '  So e.g. version 2.01 will return 201 from this call.
  150. '
  151. Declare Function TWAIN_State Lib "EZTW32.DLL" Alias "TWAIN_State" () as Long
  152. '
  153. '  Returns the TWAIN Protocol State per the spec.
  154. '
  155. %TWAIN_PRESESSION    = 1 '  source manager not loaded
  156. %TWAIN_SM_LOADED = 2 '  source manager loaded
  157. %TWAIN_SM_OPEN    = 3 '  source manager open
  158. %TWAIN_SOURCE_OPEN = 4 '  source open but not enabled
  159. %TWAIN_SOURCE_ENABLED = 5 '  source enabled to acquire
  160. %TWAIN_TRANSFER_READY = 6 '  image ready to transfer
  161. %TWAIN_TRANSFERRING = 7 '  image in transit
  162. ' --------- DIB handling utilities ---------
  163. Declare Function TWAIN_DibDepth Lib "EZTW32.DLL" Alias "TWAIN_DibDepth" _
  164.       ( ByVal hdib as Long ) as Long
  165. Declare Function TWAIN_DibWidth Lib "EZTW32.DLL" Alias "TWAIN_DibWidth" _
  166.       ( ByVal hdib as Long ) as Long
  167.             
  168. Declare Function TWAIN_DibHeight Lib "EZTW32.DLL" Alias "TWAIN_DibHeight" _
  169.       ( ByVal hdib as Long ) as Long
  170.       
  171. Declare Function TWAIN_DibNumColors Lib "EZTW32.DLL" Alias "TWAIN_DibNumColors" _
  172.       ( ByVal hdib as Long ) as Long
  173. Declare Function TWAIN_RowSize Lib "EZTW32.DLL" Alias "TWAIN_RowSize" _
  174.       ( ByVal hdib as Long ) as Long
  175.       
  176. Declare Sub TWAIN_ReadRow Lib "EZTW32.DLL" Alias "TWAIN_ReadRow" _
  177.       ( ByVal hdib as Long, ByVal nRow as Long, prow as Any )
  178. '
  179. '  Read row n of the given DIB into buffer at prow.
  180. '  Caller is responsible for ensuring buffer is large enough.
  181. '  Row 0 is the *top* row of the image, as it would be displayed.
  182. '
  183. Declare Function TWAIN_CreateDibPalette Lib "EZTW32.DLL" Alias "TWAIN_CreateDibPalette" _
  184.       ( ByVal hdib as Long ) as Long
  185. '
  186. '  Create and return a logical palette to be used for drawing the DIB.
  187. '  For 1, 4, and 8-bit DIBs the palette contains the DIB color table.
  188. '  For 24-bit DIBs, a default halftone palette is returned.
  189. '
  190. Declare Sub TWAIN_DrawDibToDC Lib "EZTW32.DLL" Alias "TWAIN_DrawDibToDC" _
  191.       ( ByVal hDC as Long, ByVal dx as Long, ByVal dy as Long, _
  192.         ByVal w as Long, ByVal h as Long, ByVal hdib as Long, _
  193.         ByVal sx as Long, ByVal sy as Long )
  194. '
  195. '  Draws a DIB on a device context.
  196. '  You should call CreateDibPalette, select that palette
  197. '  into the DC, and do a RealizePalette(hDC) first.
  198. '
  199. ' --------- BMP file utilities
  200. Declare Function TWAIN_WriteNativeToFilename Lib "EZTW32.DLL" Alias "TWAIN_WriteNativeToFilename" _
  201.       ( ByVal hdib as Long, zFile as Asciiz ) as Long
  202. '      
  203. '  Writes a DIB handle to a .BMP file
  204. '
  205. '  hdib = DIB handle, as returned by TWAIN_AcquireNative
  206. '  pszFile = far pointer to NUL-terminated filename
  207. '  If pszFile is NULL or points to a null string, prompts the user
  208. '  for the filename with a standard file-save dialog.
  209. '
  210. '  Return values:
  211. ' 0 success
  212. ' -1 user cancelled File Save dialog
  213. ' -2 file open error (invalid path or name, or access denied)
  214. ' -3 (weird) unable to lock DIB - probably an invalid handle.
  215. ' -4 writing BMP data failed, possibly output device is full
  216. '
  217. Declare Function TWAIN_WriteNativeToFile Lib "EZTW32.DLL" Alias "TWAIN_WriteNativeToFile" _
  218.       ( ByVal hdib as Long, ByVal hFile as Long ) as Long
  219. '
  220. '  Writes a DIB to a file in .BMP format.
  221. '
  222. '  hdib = DIB handle, as returned by TWAIN_AcquireNative
  223. '  fh = file handle, as returned by _open, _lopen or OpenFile
  224. '
  225. '  Return value as for TWAIN_WriteNativeToFilename
  226. '
  227. Declare Function TWAIN_LoadNativeFromFilename Lib "EZTW32.DLL" Alias "TWAIN_LoadNativeFromFilename" _
  228.       ( zFile as Asciiz ) as Long
  229. '
  230. '  Load a .BMP file and return a DIB handle (as from AcquireNative.)
  231. '  Accepts a filename (including path & extension).
  232. '  If pszFile is NULL or points to a null string, the user is prompted.
  233. '  Returns a DIB handle if successful, otherwise NULL.
  234. '
  235. Declare Function TWAIN_LoadNativeFromFile Lib "EZTW32.DLL" Alias "TWAIN_LoadNativeFromFile" _
  236.       ( ByVal fh as Long ) as Long
  237. '
  238. '  Like LoadNativeFromFilename, but takes an already open file handle.
  239. '
  240. Declare Sub TWAIN_SetHideUI Lib "EZTW32.DLL" Alias "TWAIN_SetHideUI" _
  241.       ( ByVal fHide as Long )
  242.       
  243. Declare Function TWAIN_GetHideUI Lib "EZTW32.DLL" Alias "TWAIN_GetHideUI" () as Long
  244. '
  245. '  These functions control the 'hide source user interface' flag.
  246. '  This flag is cleared initially, but if you set it non-zero, then when
  247. '  a source is enabled it will be asked to hide its user interface.
  248. '  Note that this is only a request - some sources will ignore it!
  249. '  This affects AcquireNative, AcquireToClipboard, and EnableSource.
  250. '  If the user interface is hidden, you will probably want to set at least
  251. '  some of the basic acquisition parameters yourself - see
  252. '  SetCurrentUnits, SetBitDepth, SetCurrentPixelType and
  253. '  SetCurrentResolution below.
  254. '
  255. ' --------- Application Registration
  256. Declare Sub TWAIN_RegisterApp Lib "EZTW32.DLL" Alias "TWAIN_RegisterApp" _
  257.       ( ByVal nMajorNum as Long, ByVal nMinorNum as Long, _
  258.         ByVal nLanguage as Long, ByVal nCountry as Long, _
  259.         zVersion as Asciiz, zMfg as Asciiz, zProduct as Asciiz )
  260.         '
  261. '  TWAIN_RegisterApp can be called *AS THE FIRST CALL*, to register the
  262. '  application. If this function is not called, the application is given a
  263. '  'generic' registration by EZTWAIN.
  264. '  Registration only provides this information to the Source Manager and any
  265. '  sources you may open - it is used for debugging, and (frankly) by some
  266. '  sources to give special treatment to certain applications.
  267. ' --------- Error Analysis and Reporting ------------------------------------
  268. Declare Function TWAIN_GetResultCode Lib "EZTW32.DLL" Alias "TWAIN_GetResultCode" () as Dword
  269. '
  270. '  Return the result code (TWRC_xxx) from the last triplet sent to TWAIN
  271. '
  272. Declare Function TWAIN_GetConditionCode Lib "EZTW32.DLL" Alias "TWAIN_GetConditionCode" () as Dword
  273. '
  274. '  Return the condition code from the last triplet sent to TWAIN.
  275. '  (To be precise, from the last call to TWAIN_DS below)
  276. '  If a source is NOT open, return the condition code of the source manager.
  277. '
  278. Declare Sub TWAIN_ErrorBox Lib "EZTW32.DLL" Alias "TWAIN_ErrorBox" ( zMsg as Asciiz )
  279. '
  280. '  Post an error message dialog with an exclamation mark, OK button,
  281. '  and the title 'TWAIN Error'.
  282. '  pszMsg points to a null-terminated message string.
  283. '
  284. Declare Sub TWAIN_ReportLastError Lib "EZTW32.DLL" Alias "TWAIN_ReportLastError" ( zMsg as Asciiz )
  285. '
  286. '  Like TWAIN_ErrorBox, but if some details are available from
  287. '  TWAIN about the last failure, they are included in the message box.
  288. '
  289. ' --------- TWAIN State Control ------------------------------------
  290. Declare Function TWAIN_LoadSourceManager Lib "EZTW32.DLL" Alias "TWAIN_LoadSourceManager" () as Long
  291. '
  292. '  Finds and loads the Data Source Manager, TWAIN.DLL.
  293. '  If Source Manager is already loaded, does nothing and returns TRUE.
  294. '  This can fail if TWAIN.DLL is not installed (in the right place), or
  295. '  if the library cannot load for some reason (insufficient memory?) or
  296. '  if TWAIN.DLL has been corrupted.
  297. Declare Function TWAIN_OpenSourceManager Lib "EZTW32.DLL" Alias "TWAIN_OpenSourceManager" _
  298.       ( ByVal hwnd as Long ) as Long
  299. '
  300. '  Opens the Data Source Manager, if not already open.
  301. '  If the Source Manager is already open, does nothing and returns TRUE.
  302. '  This call will fail if the Source Manager is not loaded.
  303. '
  304. Declare Function TWAIN_OpenDefaultSource Lib "EZTW32.DLL" Alias "TWAIN_OpenDefaultSource" () as Long
  305. '
  306. '  This opens the source selected in the Select Source dialog.
  307. '  If a source is already open, does nothing and returns TRUE.
  308. '  Fails if the source manager is not loaded and open.
  309. '
  310. Declare Function TWAIN_EnableSource Lib "EZTW32.DLL" Alias "TWAIN_EnableSource" _
  311.       ( ByVal hwnd as Long ) as Long
  312. '
  313. '  Enables the open Data Source. This posts the source's user interface
  314. '  and allows image acquisition to begin.  If the source is already enabled,
  315. '  this call does nothing and returns TRUE.
  316. '
  317. Declare Function TWAIN_DisableSource Lib "EZTW32.DLL" Alias "TWAIN_DisableSource" () as Long
  318. '
  319. '  Disables the open Data Source, if any.
  320. '  This closes the source's user interface.
  321. '  If there is not an enabled source, does nothing and returns TRUE.
  322. '
  323. Declare Function TWAIN_CloseSource Lib "EZTW32.DLL" Alias "TWAIN_CloseSource" () as Long
  324. '
  325. '  Closes the open Data Source, if any.
  326. '  If the source is enabled, disables it first.
  327. '  If there is not an open source, does nothing and returns TRUE.
  328. '
  329. Declare Function TWAIN_CloseSourceManager Lib "EZTW32.DLL" Alias "TWAIN_CloseSourceManager" _
  330.       ( ByVal hwnd as Long ) as Long
  331. '      
  332. '  Closes the Data Source Manager, if it is open.
  333. '  If a source is open, disables and closes it as needed.
  334. '  If the Source Manager is not open, does nothing and returns TRUE.
  335. '
  336. Declare Function TWAIN_UnloadSourceManager Lib "EZTW32.DLL" Alias "TWAIN_UnloadSourceManager" () as Long
  337. '
  338. '  Unloads the Data Source Manager i.e. TWAIN.DLL - releasing
  339. '  any associated memory or resources.
  340. '  This call will fail if the Source Manager is open, otherwise
  341. '  it always succeeds and returns TRUE.
  342. '
  343. Declare Function TWAIN_MessageHook Lib "EZTW32.DLL" Alias "TWAIN_MessageHook" _
  344.       ( ptrMsg as Any ) as Long
  345. '
  346. '  This function detects Windows messages that should be routed
  347. '  to an enabled Data Source, and picks them off.  In a full TWAIN
  348. '  app, TWAIN_MessageHook is called inside the main GetMessage loop.
  349. '  The skeleton code looks like this:  
  350. ' MSG msg;
  351. '   while (GetMessage((LPMSG)&msg, NULL, 0, 0)) {
  352. ' if (!TWAIN_MessageHook ((LPMSG)&msg)) {
  353. ' TranslateMessage ((LPMSG)&msg);
  354. ' DispatchMessage ((LPMSG)&msg);
  355. ' }
  356. ' } '  while
  357. '
  358. Declare Function TWAIN_WaitForNativeXfer Lib "EZTW32.DLL" Alias "TWAIN_WaitForNativeXfer" _
  359.       ( ByVal hwnd as Long ) as Long
  360. Declare Sub TWAIN_ModalEventLoop Lib "EZTW32.DLL" Alias "TWAIN_ModalEventLoop" ()
  361. '
  362. '  Process messages until termination, source disable, or image transfer.
  363. '
  364. Declare Function TWAIN_EndXfer Lib "EZTW32.DLL" Alias "TWAIN_EndXfer" () as Long
  365. Declare Function TWAIN_AbortAllPendingXfers Lib "EZTW32.DLL" Alias "TWAIN_AbortAllPendingXfers" () as Long
  366. Declare Function TWAIN_WriteDibToFile Lib "EZTW32.DLL" Alias "TWAIN_WriteDibToFile" _
  367.       ( lpDIB as BITMAPINFOHEADER, ByVal hFile as Long ) as Long
  368. '
  369. '  Writes a DIB to a file in .BMP format.
  370. '  Returns TRUE if successful, FALSE otherwise.
  371. '  (Likely causes of failure: device full, or permission denied to write to file or device
  372. '  lpDIB = pointer to DIB, as from GlobalLock of DIB handle
  373. '  fh = file handle, as returned by C _open or Windows _lopen or OpenFile
  374. '  For example of use, see TWAIN_WriteNativeToFilename in EZTWAIN.C
  375. '
  376. ' --------- High-level Capability Negotiation Functions --------
  377. Declare Function TWAIN_NegotiateXferCount Lib "EZTW32.DLL" Alias "TWAIN_NegotiateXferCount" _
  378.       ( ByVal nXFers as Long ) as Long
  379. '
  380. '  Negotiate with open Source the number of images application will accept.
  381. '  This is only allowed in State 4 (TWAIN_SOURCE_OPEN)
  382. '  nXfers = -1 means any number
  383. '
  384. Declare Function TWAIN_NegotiatePixelTypes Lib "EZTW32.DLL" Alias "TWAIN_NegotiatePixelTypes" _
  385.       ( ByVal wPixTypes as Dword ) as Long
  386. '
  387. '  Negotiate with the source to restrict pixel types that can be acquired.
  388. '  This tries to restrict the source to a *set* of pixel types,
  389. '  See TWAIN_AcquireNative above for some mask constants.
  390. '  --> This is only allowed in State 4 (TWAIN_SOURCE_OPEN)
  391. '  A parameter of 0 (TWAIN_ANYTYPE) causes no negotiation & no restriction.
  392. '  You should not assume that the source will honor your restrictions, even
  393. '  if this call succeeds!
  394. '
  395. Declare Function TWAIN_GetCurrentUnits Lib "EZTW32.DLL" Alias "TWAIN_GetCurrentUnits" () as Long
  396. '
  397. '  Ask the source what its current unit of measure is.
  398. '  If anything goes wrong, this function just returns TWUN_INCHES (0).
  399. '
  400. Declare Function TWAIN_SetCurrentUnits Lib "EZTW32.DLL" Alias "TWAIN_SetCurrentUnits" _
  401.       ( ByVal nUnits as Long ) as Long
  402. '
  403. '  Set the current unit of measure for the source.
  404. '  Unit of measure codes are in TWAIN.H, but TWUN_INCHES is 0.
  405. '
  406. Declare Function TWAIN_GetBitDepth Lib "EZTW32.DLL" Alias "TWAIN_GetBitDepth" () as Long
  407. '
  408. '  Get the current bitdepth, which can depend on the current PixelType.
  409. '  Bit depth is per color channel e.g. 24-bit RGB has bit depth 8.
  410. '  If anything goes wrong, this function returns 0.
  411. '
  412. Declare Function TWAIN_SetBitDepth Lib "EZTW32.DLL" Alias "TWAIN_SetBitDepth" _
  413.       ( ByVal nBits as Long ) as Long
  414. '
  415. '  (Try to) set the current bitdepth (for the current pixel type).
  416. '
  417. Declare Function TWAIN_GetPixelType Lib "EZTW32.DLL" Alias "TWAIN_GetPixelType" () as Long
  418. '
  419. '  Ask the source for the current pixel type.
  420. '  If anything goes wrong (it shouldn't), this function returns 0 (TWPT_BW).
  421. '
  422. Declare Function TWAIN_SetCurrentPixelType Lib "EZTW32.DLL" Alias "TWAIN_SetCurrentPixelType" _
  423.       ( ByVal nPixType as Long ) as Long
  424. '
  425. '  (Try to) set the current pixel type for acquisition.
  426. '  This is only allowed in State 4 (TWAIN_SOURCE_OPEN)
  427. '  The source may select this pixel type, but don't assume it will.
  428. '
  429. Declare Function TWAIN_GetCurrentResolution Lib "EZTW32.DLL" Alias "TWAIN_GetCurrentResolution" () as Double
  430. '
  431. '  Ask the source for the current (horizontal) resolution.
  432. '  Resolution is in dots per current unit! (See TWAIN_GetCurrentUnits above)
  433. '  If anything goes wrong (it shouldn't) this function returns 0.0
  434. '
  435. Declare Function TWAIN_GetYResolution Lib "EZTW32.DLL" Alias "TWAIN_GetYResolution" () as Double
  436. '
  437. '  Returns the current vertical resolution, in dots per *current unit*.
  438. '  In the event of failure, returns 0.0.
  439. '
  440. Declare Function TWAIN_SetCurrentResolution Lib "EZTW32.DLL" Alias "TWAIN_SetCurrentResolution" _
  441.       ( ByVal dRes as Double ) as Long
  442. '
  443. '  (Try to) set the current resolution for acquisition.
  444. '  Resolution is in dots per current unit! (See TWAIN_GetCurrentUnits above)
  445. '  This is only allowed in State 4 (TWAIN_SOURCE_OPEN)
  446. '  Note: The source may select this resolution, but don't assume it will.
  447. '
  448. Declare Function TWAIN_SetContrast Lib "EZTW32.DLL" Alias "TWAIN_SetContrast" _
  449.       ( ByVal dCon as Double ) as Long
  450. '
  451. '  (Try to) set the current contrast for acquisition.
  452. '  The TWAIN standard says that the range for this cap is -1000 ... +1000
  453. '
  454. Declare Function TWAIN_SetBrightness Lib "EZTW32.DLL" Alias "TWAIN_SetBrightness" _
  455.       ( ByVal dBri as Double ) as Long
  456. '      
  457. '  (Try to) set the current brightness for acquisition.
  458. '  The TWAIN standard says that the range for this cap is -1000 ... +1000
  459. '
  460. Declare Function TWAIN_SetXferMech Lib "EZTW32.DLL" Alias "TWAIN_SetXferMech" _
  461.       ( ByVal mech as Long ) as Long
  462. Declare Function TWAIN_XferMech Lib "EZTW32.DLL" Alias "TWAIN_XferMech" () as Long
  463. '
  464. '  (Try to) set or get the transfer mode - one of the following:
  465. '
  466. %XFERMECH_NATIVE    = 0
  467. %XFERMECH_FILE      = 1
  468. %XFERMECH_MEMORY    = 2
  469. '
  470. ' --------- Low-level Capability Negotiation Functions --------
  471. '
  472. '  Setting a capability is valid only in State 4 (TWAIN_SOURCE_OPEN)
  473. '  Getting a capability is valid in State 4 or any higher state.
  474. '
  475. Declare Function TWAIN_SetCapOneValue Lib "EZTW32.DLL" Alias "TWAIN_SetCapOneValue" _
  476.       ( ByVal cap as dword, ByVal itemType as dword, byVal itemVal as Long ) as Long
  477. '
  478. '  Do a DAT_CAPABILITY/MSG_SET, on capability 'Cap' (e.g. ICAP_PIXELTYPE,
  479. '  CAP_AUTOFEED, etc.) using a TW_ONEVALUE container with the given item type
  480. '  and value.  The item value must fit into 32 bits.
  481. '  Returns TRUE (1) if successful, FALSE (0) otherwise.
  482. '
  483. Declare Function TWAIN_GetCapCurrent Lib "EZTW32.DLL" Alias "TWAIN_GetCapCurrent" _
  484.       ( ByVal cap as dword, ByVal itemType as dword, pVal as Any ) as Long
  485. '
  486. '  Do a DAT_CAPABILITY/MSG_GETCURRENT on capability 'Cap'.
  487. '  Copy the current value out of the returned container into *pVal.
  488. '  If the operation fails (the source refuses the request), or if the
  489. '  container is not a ONEVALUE or ENUMERATION, or if the item type of the
  490. '  returned container is incompatible with the expected TWTY_ type in nType,
  491. '  returns FALSE.  If this function returns FALSE, *pVal is not touched.
  492. '
  493. Declare Function TWAIN_ToFix32 Lib "EZTW32.DLL" Alias "TWAIN_ToFix32" _
  494.       ( ByVal d as Double ) as Long
  495. '
  496. '  Convert a floating-point value to a 32-bit TW_FIX32 value that can be passed
  497. '  to e.g. TWAIN_SetCapOneValue
  498. '
  499. Declare Function TWAIN_Fix32ToFloat Lib "EZTW32.DLL" Alias "TWAIN_Fix32ToFloat" _
  500.       ( ByVal nfix as Long ) as Double
  501. '
  502. '  Convert a TW_FIX32 value (as returned from some capability inquiries)
  503. '  to a double (floating point) value.
  504. ' --------- Lowest-level functions for TWAIN protocol --------
  505. Declare Function TWAIN_DS Lib "EZTW32.DLL" Alias "TWAIN_DS" _
  506.       ( ByVal dg as Dword, ByVal dat as dword, ByVal msg as Dword, pData as Any ) as Long
  507. '
  508. '  Passes the triplet (DG, DAT, MSG, pData) to the open data source if any.
  509. '  Returns 1 (TRUE) if the result code is TWRC_SUCCESS, 0 (FALSE) otherwise.
  510. '  The last result code can be retrieved with TWAIN_GetResultCode(), and the corresponding
  511. '  condition code can be retrieved with TWAIN_GetConditionCode().
  512. '  If no source is open this call will fail, result code TWRC_FAILURE, condition code TWCC_NODS.
  513. '
  514. Declare Function TWAIN_Mgr Lib "EZTW32.DLL" Alias "TWAIN_Mgr" _
  515.       ( ByVal dg as Dword, ByVal dat as Dword, ByVal msg as DWord, pData as Any) as Long
  516. '
  517. 'int EZTAPI TWAIN_Mgr(unsigned long DG, unsigned DAT, unsigned MSG, void FAR *pData);
  518. '
  519. '  Passes a triplet to the Data Source Manager (DSM).
  520. '  Returns 1 (TRUE) if the result code is TWRC_SUCCESS, 0 (FALSE) otherwise.
  521. '  The last result code can be retrieved with TWAIN_GetResultCode(), and the corresponding
  522. '  condition code can be retrieved with TWAIN_GetConditionCode().
  523. '  If the Source Manager is not open, this call will fail, and set the result code to TWRC_FAILURE,
  524. '  with a condition code of TWCC_SEQERROR (triplet out of sequence).
  525. #endif

Ответить

Номер ответа: 3
Автор ответа:
 Kardinal



ICQ: 360041513 

Вопросов: 1
Ответов: 164
 Web-сайт: kg7.ru
 Профиль | | #3
Добавлено: 06.12.08 14:08
толбко EZTW32.DLL не у всех есть, ОСХ - компонент будет более доступным выходом

Ответить

Номер ответа: 4
Автор ответа:
 Фeнягz



Вопросов: 2
Ответов: 62
 Web-сайт: atauenis.narod.ru
 Профиль | | #4
Добавлено: 07.12.08 01:11
Кажется, EZTW32.DLL входит в комплект поставки Windows, начиная с Windows95. Думаю, должна она быть и в других OS. Можна посмотреть детали тут http://www.twain.org/

Ну, на крайняк, можно включить эту библиотеку в комплект пакета установки.

Однако с уверенностю можна говорить - это наиболее оптимальный выбор по сравнению с прочими вариантами.

Ответить

Номер ответа: 5
Автор ответа:
 Lion



ICQ: 367220539 

Вопросов: 13
Ответов: 55
 Web-сайт: lammeru.net
 Профиль | | #5
Добавлено: 08.12.08 00:08
Всем Спасибо!!! Нашел. http://www.catenary.com/download/welcome.html файлик loadpic.zip Там все есть если кому надо.

Ответить

Номер ответа: 6
Автор ответа:
 Фeнягz



Вопросов: 2
Ответов: 62
 Web-сайт: atauenis.narod.ru
 Профиль | | #6
Добавлено: 08.12.08 01:13
Ты б лучше сказал, что вверху на баннере написано

Victor Library
$499
BUY NOW


А затем спросил кому оно надо.

Ответить

Номер ответа: 7
Автор ответа:
 Фeнягz



Вопросов: 2
Ответов: 62
 Web-сайт: atauenis.narod.ru
 Профиль | | #7
Добавлено: 08.12.08 03:10
Это бесплатно :d

http://www.dosadi.com/eztwain1.htm

-- Contents of the EZTwain Classic package (eztw1.zip)

If you unzip the distribution package to the root of a drive using
the path information, you'll get the folder \EZTWAIN1 at the top,
and the following files inside:

README.TXT this file.
ACCESS\EZTWAIN.BAS declaration file for MS Access
CLARION\EZTW32.LIB object library for use with Clarion
CLARION\EZTWAIN.CLW Clarion declarations (I think...)
CLARION\README.TXT notes on using EZTwain from Clarion
CSHARP\EZTWAIN.CS C# declarations
DBASE\EZTWAIN.H declarations for dBase
DELPHI\EZTWAIN.PAS declarations for Delphi
LotusScript\eztwain.lss declarations for Lotus Notes
PERL\EZTWAIN.PL declarations for Perl
PowerBASIC\eztwain.inc declarations for PowerBASIC
PowerBuilder\eztwain.txt declarations for PowerScript 10+
PowerBuilder\eztwain-pb9.txt declarations for PowerScript 9
PROGRESS\EZTWAIN.I declarations for Progress
VB.NET\EZTWAIN.VB declarations for VB.NET
VB\EZTWAIN.BAS declarations for VB5/6
VC\EZTWAIN.C source code of EZTwain DLL
VC\EZTWAIN.H declarations for C
VC\RESOURCE.H resource defines
VC\TWAIN.H TWAIN standard header file
VC\TWERP.C Twerp sample application, in C
VC\TWERP.ICO Twerp application icon
VC\TWERP.RC Twerp application resources
VC\VC.DSW MSVC 6.0 workspace for Eztwain and Twerp
VC\EZTW32\EZTW32.DEF export definition file for eztw32.dll
VC\EZTW32\EZTW32.DSP MSVC project file for eztw32.dll
VC\RELEASE\EZTW32.DLL pre-built release version of EZTwain DLL
VC\RELEASE\EZTW32.LIB link library of eztw32.dll
VC\RELEASE\TWERP32.EXE pre-built Twerp sample app
VC\TWERP32\TWERP32.DSP MSVC 6 project file for Twerp
VFP\EZTWAIN.PRG declarations for Visual FoxPro


А тут есть пример создания Net-обложки с демо программой (Net Framework 2.0; vb2005)

http://www.vbdotnetheaven.com/UploadFile/progalex/ads_acquirepicturesvb200502032006170523PM/ads_acquirepicturesvb2005.aspx

Ответить

Номер ответа: 8
Автор ответа:
 Lion



ICQ: 367220539 

Вопросов: 13
Ответов: 55
 Web-сайт: lammeru.net
 Профиль | | #8
Добавлено: 08.12.08 12:57
Да ладно))) Ты хочешь сказать, что у тебя на все лицензия есть?!))) Тронут за заботу. Все равно Спасибо.

Ответить

Номер ответа: 9
Автор ответа:
 Фeнягz



Вопросов: 2
Ответов: 62
 Web-сайт: atauenis.narod.ru
 Профиль | | #9
Добавлено: 09.12.08 01:07
В том и дело. Что на Victors Library у меня её нет. О. Зато у Виктора нет $499. :d

Ответить

Страница: 1 |

Поиск по форуму



© Copyright 2002-2011 VBNet.RU | Пишите нам