LTwain::SetRGBResponse

#include "ltwrappr.h"

L_INT LTwain::SetRGBResponse (pRgbResponse, nBitsPerPixel, uFlag)

Sets the RGB elements used when transferring data from the current TWAIN source.

Parameters

pTW_RGBRESPONSE pRgbResponse

Pointer to a TW_RGBRESPONSE structure that references the RGB elements to be set for the TWAIN source. For more information about TW_RGBRESPONSE, refer to the TWAIN specification.

L_INT nBitsPerPixel

Bits per pixel to be set. This is used to determine the number of RGB elements in the TW_RGBRESPONSE structure.

L_UINT uFlag

Flags that indicate whether to set or reset the RGB elements for the TWAIN source. Possible values are:

Value Meaning
TWAIN_RGB_RESPONSE_SET [0x0001] Set the RGB elements for the current TWAIN source using the information provided.
TWAIN_RGB_RESPONSE_RESET [0x0002] Reset the RGB elements for the current TWAIN source to the default values. Note: Defaults vary from TWAIN source to TWAIN source.

Returns

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

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LTwain__SetRGBResponseExample(LTwain * plTwain)  
 
{ 
   L_INT             nRet; 
   pTW_RGBRESPONSE   pRgbResponse = NULL;  
 
   pRgbResponse = (pTW_RGBRESPONSE)GlobalAllocPtr(GHND, sizeof(TW_RGBRESPONSE) + sizeof(TW_ELEMENT8) * 2);  
 
   if (pRgbResponse)  
 
   { 
      pRgbResponse->Response[0].Index     = 0;  
      pRgbResponse->Response[0].Channel1  = 0;  
      pRgbResponse->Response[0].Channel2  = 0;  
      pRgbResponse->Response[0].Channel3  = 0;  
 
      pRgbResponse->Response[1].Index     = 1;  
      pRgbResponse->Response[1].Channel1  = 255;  
      pRgbResponse->Response[1].Channel2  = 255;  
      pRgbResponse->Response[1].Channel3  = 255;  
 
      nRet = plTwain->SetRGBResponse(pRgbResponse, 1, TWAIN_RGB_RESPONSE_SET);  
      if(nRet != SUCCESS) 
         return nRet; 
 
   } 
 
   return SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.