L_SaneAcquire

#include "ltsane.h"

L_LTSANE_API L_INT L_SaneAcquire(hSane, bitmap, structSize)

L_SaneHandle hSane;

sane handle

pBITMAPHANDLE bitmap;

the acquired bitmapHandle

L_UINT uStructSize;

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

Acquires an image from a SANE device.

Parameter

Description

hSane SANE handle
bitmap The acquired bitmapHandle
uStructSize Size, in bytes, of the structure pointed to by bitmap

Returns

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

LTSANE

For a listing of the exact .so libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

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 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.