DTWAIN_SetLightSources

Top  Previous  Next

The DTWAIN_SetLightSources sets the current light sources being used.

 

DTWAIN_BOOL DTWAIN_SetLightSources (

DTWAIN_SOURCE

Source,

DTWAIN_ARRAY

LightSources );

 

Parameters

Source

An open TWAIN Source.

 

pLightPath

Pointer to DTWAIN_ARRAY of light sources to use.

 

 

Return Values

The return value is TRUE if successful.  Otherwise FALSE is returned.

 

Comments

The DTWAIN_SetLightSources function sets the current light sources being used.  The light source determines which lamp will be used when acquiring an image (some devices have multiple lamps).  The LightSources must be a DTWAIN_ARRAY created with the DTWAIN_ARRAYLONG style.  The values to use when populating the DTWAIN_ARRAY must be one of the Light Source Constants.

 

Example:

 

void Func( )

{

   DTWAIN_ARRAY LightSources;

   DTWAIN_SOURCE Source;

   //...

   LightSources = DTWAIN_ArrayCreate( DTWAIN_ARRAYLONG, 0 );

 

   // Add red and blue light sources

   DTWAIN_ArrayAddLong( LightSources, DTWAIN_LS_RED );

   DTWAIN_ArrayAddLong( LightSource, DTWAIN_LS_BLUE );

   if  ( DTWAIN_SetLightSources( Source, LightSources ) == TRUE )

   {

         // values accepted by Source

   }

   else

   {

      // values not accepted.  Get the error

     LONG nError = DTWAIN_GetLastError( );

   }

   //...

   DTWAIN_ArrayDestroy( LightSources );

}

 

TWAIN State Transitions

The Source must be in State 4. or higher

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

DTWAIN Source Selection Function

 

See Also

Color Lamp Selection