Home › Forums › TWAIN Classic › Capability ICAP_BRIGHTNESS setting not reflecting in state 4
- This topic has 1 reply, 2 voices, and was last updated 16 years, 11 months ago by gabe.
- AuthorPosts
Hi
Any one knows what could be the problem ,im setting the brightness
with in the range from source ,but does not reflect the setting when i say “acquire” below is the code
TwainStat twainScanner; //initialization pre-session state 1
vectordeviceNames;
TW_BOOL sourManagerLoaded = twainScanner.loadSourceManager(); //state 2 source manager loaded
twainScanner.registerApp(1,3,TWLG_ENGLISH_USA,
TWCY_INDIA,"My Application Version Information","Elvista Digital Systems",
"OMR","IGrader");
twainScanner.openSourceManager(); //state 3 open source manager
//twainScanner.showSMNativeSources();
deviceNames = twainScanner.listSMSources(); //list available sources.
if(deviceNames.size() == 0){
printf("vector list is empty");
}else
{
for(int i = 0;i{
printf("nn %d devices %s",(i+1),deviceNames.at(i).c_str());
}
}
std::string strd = deviceNames.at(2);
TW_IDENTITY source = twainScanner.getSourceIdentity((LPSTR)strd.c_str());
twainScanner.openSource(source); //for loading and initializing the source(state 4);open_source
//twainScanner.listSupportedCapabilities(source);
//TW_FIX32 bright = twainScanner.FloattoFix32( 1000.0);
// printf("nFraction %f ",bright.Frac);
//printf("nWhole number %d",bright.Whole);
TW_UINT16 itemType;
TW_UINT32 item = 100;
TW_FIX32 fix32Val = twainScanner.FloattoFix32( 100 );
itemType = TWTY_FIX32;
// item = fix32Val;
twainScanner.showNativeSourceInterface( source,false );//showing the native source interface.(state 5);source_enabled
twainScanner.setCapability( source, itemType,item );
twainScanner.getCapability( ICAP_BRIGHTNESS ,source ); //here i can't see the changes on the settings
//twainScanner.listSupportedCapabilities(source);
twainScanner.ApplicationEventLoop( source );
twainScanner.freeDLLibrary();
Thanks for any help[/list]
I would send a msg_get to the source in a twon_range and check the stepsize. If everything else is working I’d guess that the source is using 1000 as the stepsize and rounding the 100 you’re trying to set down.
Check the rc/cc for your calls to see if you’re failing for some reason and checking supportedCaps with querysupport will also occationally provide some insight.
One question, you call:
twainScanner.showNativeSourceInterface( source,false );
just before you set and get the values. Is the vendor Ui up when you get and set the values?
.
- AuthorPosts