Image Options 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;
}

float fContrast, fHighlight;

pRasterTwain->InitSession((long)GetSafeHwnd());
pRasterTwain->SelectSource();
pRasterTwain->get_ImageContrast (&fContrast);
pRasterTwain->get_ImageHighlight (&fHighlight);

CString csMsg;
csMsg.Format(TEXT("Image Contrst = %d\nImage Highlight = %d\n"), fContrast, fHighlight);
MessageBox(csMsg);

pRasterTwain->put_ImageBrightness (100.0);

pRasterTwain->put_PaperSize(L_TWSS_A4);
pRasterTwain->put_PaperDirection (L_TWOR_LANDSCAPE);