L_SaneAcquire

#include "ltsane.h"

L_LTSANE_API L_INT L_SaneAcquire(hSane, bitmap, structSize)

Acquires an image from a SANE device.

Parameters

L_SaneHandle hSane

SANE handle

pBITMAPHANDLE bitmap

The acquired bitmapHandle

L_UINT structSize

Size, in bytes, of the structure pointed to by bitmap

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Initiate the SANE handle (hSane) before acquiring images.

Required DLLs and Libraries

Platforms

Linux

Example

This example shows how to acquire a colored image.

L_INT AcquireImage(L_SaneHandle hSane, pBITMAPHANDLE bitmap) 
{ 
   // Get the scanning mode value 
   L_TCHAR* value = NULL; 
   L_INT ret = L_SaneGetOptionValue(hSane, SANE_NAME_SCAN_MODE, &value); 
   if(ret != SUCCESS) 
      return ret; 
 
   if(strcmp(value, SANE_VALUE_SCAN_MODE_COLOR) != 0) 
   { 
      // Set the scanning mode to "Color" 
      ret = L_SaneSetOptionValue(hSane, SANE_NAME_SCAN_MODE, SANE_VALUE_SCAN_MODE_COLOR); 
   } 
 
   // Free the value buffer 
   L_SaneFreeMemory(value); 
 
   // Scan an image 
   return L_SaneAcquire(hSane, bitmap, sizeof(BITMAPHANDLE)); 
} 

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.