RGB Response Example for C++ 5.0 and later

ILEADRasterTwain_U * pRasterTwain;

HRESULT hr = ::CoCreateInstance(CLSID_LEADRasterTwain_U, NULL, CLSCTX_ALL, IID_ILEADRasterTwain_U, (void **)&pRasterTwain);
if (FAILED(hr) || !pRasterTwain)
{
	::MessageBox (NULL, _TEXT("Failed to create a Raster Twain Object"), _TEXT("Error"), MB_OK);
	return;
}

pRasterTwain->InitSession((long)GetSafeHwnd()); 
pRasterTwain->SelectSource();

pRasterTwain->put_RGBElementsCount (2);

pRasterTwain->GetRGBElements(0)->Index = 0;
pRasterTwain->GetRGBElements(0)->Channel1 = 0;
pRasterTwain->GetRGBElements(0)->Channel2 = 0;
pRasterTwain->GetRGBElements(0)->Channel3 = 0;

pRasterTwain->GetRGBElements(1)->Index = 1;
pRasterTwain->GetRGBElements(1)->Channel1 = 255;
pRasterTwain->GetRGBElements(1)->Channel2 = 255;
pRasterTwain->GetRGBElements(1)->Channel3 = 255;

pRasterTwain->SetRGBResponse (L_TWAIN_RGB_RESPONSE_SET, 1);