GetProperties example for C++ Builder
int __fastcall TForm1::LEADTwain1SetPropertiesEvent(DWORD uCap,
int nStatus, Pointer pValue)
{
// Do your error notification or any other code here.
return SUCCESS;
}
void __fastcall TForm1::btnGetPropertiesClick(TObject *Sender)
{
L_INT nRet;
LTWAINPROPERTIES twProps;
// Initialize to zero
FillMemory ( &twProps, sizeof(LTWAINPROPERTIES), 0 );
// Get the current properties of the selected twain source
nRet= LEADTwain1->GetProperties ( &twProps, LTWAIN_PROPERTIES_GETCURRENT );
if ( nRet != SUCCESS )
{
return;
}
// Change transfer mode to File
twProps.DataTransfer.nTransferMode= TWSX_FILE;
StrCopy ( twProps.DataTransfer.szFileName, "c:\\temp\\Twain.bmp" );
twProps.DataTransfer.nScanFileFormat= TWFF_BMP;
// Set the new properties
LEADTwain1->EnableSetPropertiesEvent = true;
nRet= LEADTwain1->SetProperties ( &twProps, LTWAIN_PROPERTIES_SET );
if ( nRet != SUCCESS )
{
return;
}
}