Sets the RGB elements used when transferring data from the current TWAIN source.
#include "ltwrappr.h"
L_INT LTwain::SetRGBResponse (pRgbResponse, nBitsPerPixel, uFlag)
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.
Bits per pixel to be set. This is used to determine the number of RGB elements in the TW_RGBRESPONSE structure.
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. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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;
}