Stops image acquisition from the feeder (only) of the TWAIN source.
#include "ltwrappr.h"
L_INT LTwain::StopFeeder ();
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function stops the process of acquiring images only from the feeder which was begun using one of the following functions:
In order to stop acquiring images from the feeder begun by calling the LTwain::Acquire function, call LTwain::StopFeeder within the LTwain::BitmapCallBack function when it is fired.
In order to stop acquiring images from the feeder begun by calling the LTwain::AcquireMulti or LTwain::FastAcquire, call LTwain::StopFeeder within the LTwain::AcquireCallBack function when it is fired.
If the TWAIN source has no feeder, this function will fail and return an error code.
class CMyTwainFeeder : public LTwain
{
public:
L_INT BitmapCallBack(pBITMAPHANDLE pBitmap);
HTWAINTEMPLATEFILE m_hFile;
};
L_INT CMyTwainFeeder::BitmapCallBack(pBITMAPHANDLE /*pBitmap*/)
{
StopFeeder();
return SUCCESS;
}
// initialize session and call this function
void TwainAcquire(pBITMAPHANDLE pBitmap, HWND /*hWnd*/)
{
L_INT nRet;
CMyTwainFeeder MyClass;
// Show the Twain Select Source UI
nRet = MyClass.SelectSource (NULL);
if (nRet != SUCCESS)
MessageBox (NULL, TEXT("Error occurred while selecting the source."), TEXT("ERROR"), MB_OK);
MyClass.EnableCallBack(TRUE);
nRet = MyClass.Acquire ( pBitmap,sizeof(BITMAPHANDLE), LTWAIN_SHOW_USER_INTERFACE, NULL);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("The image acquisition process completed."), TEXT("Notice"), MB_OK);
else
MessageBox(NULL, TEXT(" The image acquisition process failed!"), TEXT("Error"), MB_OK);
}