BenQ scanner secondary development package

zhaozj2021-02-08  199

BenQ scanner secondary development package

Instructions for use

BenQ Electric Information Technology Co., Ltd. · Marketing Headquarters

0512-68251233-2888

table of Contents

First, function description (3-3)

Second, the description (3-3)

Third, the development package file structure description (3-4)

Fourth, Scan.dll Interface Description (4-15)

V. Imagerwsb.dll Interface Description (15-17) ()

One. Function Description The development kit is specially provided by the BenQ scanner, which allows users to develop a developing package for secondary development. The development kit is a dynamic connection library developed by VC 6.0 (Scan.dll). The interface is simple, convenient to call, allows you to achieve functional customization of the BenQ scanner in the shortest time. In addition, the development kit also provides the user's BenQ to develop the image file read and write library (iMagerw.dll), which provides support for multiple image formats, allowing you to easily save the scanned image data into a variety of formats. The supported file format has an image file with BMP, PCX, JPG, TIF, TGA, PNG. The development routine is also accompanied by this development package. ), For example, it can be scanned with a particular resolution in a particular area. This routine also provides a demonstration that implements text identification using Hanwang OCR.

Using this development package, they can implement autonomous control of the scanner, such as self-control preview, scanning position, scan resolution color, etc., and even provide a common reading and writing, let customers It is convenient to implement the control of the scanner and the reading and writing of the image, and more time is used for the entire control management system.

It is because the secondary development package has very high scalability, so it is suitable for a variety of industries. For example: Digital Library and Digital Archives, etc. If the optical text identification software (OCR), the field is more important, such as: Travel Industry identification, airport and entry identification, police (military ) With living fingerprint, fingerprint entry, attendance, entry factory, bank financial bill, tax, transportation, engineering mapping, geological archaeological, public security household registration, etc., and industry information-oriented field. In these areas, universal scan control is not used in the place, all application systems need to be tailored, and it is necessary to flexible control, which can only be based on the high scalability of the secondary development package.

two. Demand

This development kit needs to be used with the scanner equipment provided by the BenQ and the device driver. Before use, confirm that the scanner device has been properly installed and operated.

three. Development package file structure

SDK: Root Catalog / Include: Header Directory (you need to add this directory to your VC development environment) TWAINEXPORT.H: SCAN.DLL interface definition twain.h: Standard Image Device Data Structure Type Definition iMagerw.h: Images Document read and write interface definition / library: library file directory (you need to add this directory to your VC development environment) IMGRWSB.LIB: Image file read and write interface library / src: source file directory TwainExport.cpp: / bin: Dynamic connection Library directory scan.dll: Scanner drive interface dynamic connection library formatdll.dll image file read and write dynamic connection library / sample: routine directory VC routine / document: Description file directory BenQ scanner development package instructions.doc: This document four. Scan.dll Interface Description Initialization Function 1. Hinstance InitTwaindll (LPCTSTSTTWLLNAME); Return Value If the handle of Scan.dll is successfully returned, failure is NULL. Parameter szdllname points to the absolute path name of scan.dll, the interface function must be first called success, if the call fails, check if the path name is written correct, or if the file is really existent. 2. Void FreetWaindll (Hinstance Hinst); Return Value No parameter Hinst Scan.dll handle. Note The function must be called when the program is launched, and the Scan.dll resource is released.

3. Void NewTwain; Return Value None Parameter PHTWAIN Pointer Pointer Pointer Creation Creating Control Bench Scanner Handle 4. Void FreetWaindll (HTWAIN HTWAIN); Return Value None Parameter HTWAIN Scanner Handle Note Creation Control BenQ The handle of the scanner 5. Bool LoadSm (htwain htwain); Return value success true, failed FALSE parameter HTWAIN scanner handle note Load Drive Manager 6. Bool unloadsm (htwain htwain); return value success true, failure FALSE parameter htwain scan Skills Note Unload Drive Manager 7. Bool OpenSM (HTWAIN HTWAIN); Return Value Success True, Fail False Parameters HTWAIN Scanner Handle Note Open Drive Manager 8. Bool CloseSM (Htwain Htwain); Return Value Success True, Fail False Parameters HTWAIN Scanner Handle Note Close Drive Manager 9. Bool OpenDs (HTWAIN HTWAIN); Return Value Success True, Faled False Parameters HTWAIN Scanner Handle Note Open Driver 10. Bool Closeds (Htwain Htwain); Return Value Success True, Fail False Parameter HTWAIN Scanner Handle Note Close Driver 11. Bool Enableds (HTWAIN HTWAIN, BOOL BISSHOWUI, HWND HWND); Return Value Success True, Failed False Parameters HTWAIN Scanner Handle Bisshowui True: Display Driver Interface, False: Does not display HWND driver Program Parent Window Handle Note Performance Through the driver 12. Bool Disableds (HTWAIN HTWAIN, BOOL BISSHOWUI, HWND HWND); Return Value Success True, Failed False Parameters HTWAIN Scanner Handle Bisshowui True: Driver to open the interface, FAL SE: the driver is not turned hWnd parent window handle invalid notes that the scan driver 13. BOOL DoMemXfer (HTwain hTwain, LPBITMAPINFO lpBmpInfo, LPBYTE lpData, LPSCANDATA lpScanData); BMP return a success value TRUE, FALSE parameter hTwain scanner failure handle pointing lpBmpInfo The header information of the bitmap is directed to the Pointer LPScandata, where the DIB data space is stored. Data transfer 14. Bool getDefaultdrivername (htwain htwain, char * chDRVNAME, LPCSTR LPSZNAMEFILTER / * = null * /); return value success true, failure FALSE parameters hTwain scanner chDrvName handle a string point, will return the scanner driver name lpszNameFilter resulting reserved name annotation default scanner driver 15. BOOL GetFirstDriverName (hTwain hTwain, char * chDrvName, LPCSTR lpszNameFilter / * = NULL * /) Return value success true, failure FALSE parameter HTWAIN scanner handle chDrvname points to a string,

Return to the scanner driver name lpsznamefilter Reserved Name 16. Bool getNextDrivername) (htwain htwain, char * chDRVNAME, LPCSTR LPSZNAMEFILTER / * = NULL * /); return value success true, failure FALSE Parameter HTWAIN Scanner Handle CHDRVNAME points to a string, returning the scanner driver Name LpszNameFilter Reserved Name 17. Bool getCapImageType (HTWAIN HTWAIN, INT & TY); Return Value Success TRUE, failed FALSE parameters hTwain scanner handle returned & type video image type annotation to give a black and white type TWPT_BW TWPT_GRAY color gradation TWPT_RGB 18. BOOL SetCapImageType (hTwain hTwain, int type); return value success TRUE, FALSE parameter hTwain failure handler type image scanner is provided a scanning type annotations Image Type TWPT_BW Black and White TWPT_GRAY Gray TWPT_RGB Color 19. Bool GetResRange (HTWAIN HTWAIN, INT & TMIN, INT & TMAX " The scan resolution of the scanner is obtained 20. Bool setcapxres (htwain htwain, int in); Return Value Success TRUE, failed False Parameters HTWAIN Scanner Handle RES Scan Resolution Note Set the horizontal scan resolution of the scanner. Bool setCapyres (htwain htwain, int res); return value success true, failed false parameter HTWAIN scanner handle RES Scan resolution annotation Setting Scanner Longitudinal Scan Resolution 22. Bool getScape, Double & TMIN, Double & TMAX; Return Value Success True, Failed False Parameters HTWAIN Scanner Handle & Tmin Returns a Minimum Scassion & Tmax Returns a maximum Zoom ratio annotation to get the range of reversible

23. Bool setcapxscale (HTWAIN HTWAIN, FLOAT Scale); Return Value Success TRUE failure FALSE parameter hTwain scanner handle scale scale annotation disposed scaling the image longitudinal direction 25. BOOL GetMaxScanArea (HTwain hTwain, float & tright, float & tbottom); return value success TRUE or FALSE on failure parameters hTwain scanner handle & tright returns a maximum scan Width, unit inches & tbottom Returns a maximum scan of the highest scanning to get the maximum scan range of the scanner 26. Bool Setscansize (HTWAIN HTWAIN, FLOAT FLEFT, FLOAT FTOP, FLOAT FRIGHT, FLOAT FBOTTOM); Return Value Success True, failed FALSE Parameter HTWAIN Scanner Handle Fleft Scan Range Left Boundary FTOP Scan Range FBOTTOM Scan Range Right Boundary FBOTTOM Scanning Range Randide Set Scan Range Range Range Range Range Range Range Range Range Range Range Range Range Range Wheel, Unit Inch 27. Tw_INT16 TWAINFILTER (HTWAIN HTWAIN, LPMSG LPMSG); return Value Driver Returned Message MSG_XferReady: Driver is ready to perform data transfer MSG_closedSREQ: Parameter HTWAIN Scanner Handle LPMSG Window Message Note Pass window messages to the lower driver, and return status values. Fives. Imagerwsb.dll interface description (omitted)

(Finish)

转载请注明原文地址:https://www.9cbs.com/read-2503.html

New Post(0)