TransWikia.com

Commercial or open source C++ TWAIN library for Windows

Software Recommendations Asked on November 25, 2021

Please, recommend a library for a quik start. The task is to create a new scanning module for existing MFC-application

One Answer

You could try the LEADTOOLS Twain scanning module. (Disclosure: I work for its vendor). The following C++ code lets the user select a scanner and saves the scanned image to disk:

HTWAINSESSION twainSession = NULL;
APPLICATIONDATA appData = { sizeof(APPLICATIONDATA), hWnd, TEXT("My Company"), TEXT("My Product"), TEXT("1.0"), TEXT("My App"), TWLG_ENGLISH_USA, TWCY_USA };
L_TwainInitSession(&twainSession, &appData);
L_TwainSelectSource(twainSession, NULL);
BITMAPHANDLE bmp = { 0 };
L_TwainAcquire(twainSession, &bmp, sizeof(bmp), NULL, LTWAIN_SHOW_USER_INTERFACE, NULL, NULL);
if (bmp.Flags.Allocated)
{
   L_SaveBitmap(TEXT("g:\test\scannedImage.tif"), &bmp, FILE_TIFLZW, bmp.BitsPerPixel, 0, NULL);
   L_FreeBitmap(&bmp);
}
L_TwainEndSession(&twainSession);

There’s a free evaluation for the SDK on this page. The evaluation contains advanced demos in case you need other Twain features (setting capabilities, scanning multiple images from a document feeder, etc.). There’s also free email and chat support during evaluation.

Answered by Amin M. Dodin on November 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP