Home › Forums › TWAIN Classic › How can I set the brigthness?
- This topic has 10 replies, 6 voices, and was last updated 17 years, 2 months ago by Victor.
- AuthorPosts
How can I get/set the brigthness?
I use twain with C#.
ThanksUse ICAP_BRIGHTNESS, described on page 9-433 of the specification.
I used ICAP_BRIGHTNESS, described on page 9-433 of the specification, but brightness hasn’t changed. Can you show that part of program code, where you do that?
you should do these steps before seting the capability
W_USERINTERFACE twUI;
twUI.ShowUI = FALSE;///////////////////lhg 2006.12.13/////////
twUI.ModalUI=FALSE;
twUI.hParent = (TW_HANDLE)m_hMessageWnd;
CallTwainProc(&m_AppId,&m_Source,
DG_CONTROL,DAT_USERINTERFACE,MSG_ENABLEDS,(TW_MEMREF)&twUI)Is this important that twUI.ShowUI and twUI.ModalUI have FALSE meaning? I want to set brightness, but to show window with preview too.
Which operation system do you use? I have Windows XP, and everything works well with WIA, but with Twain I have some problems. may be it dependes on OS?
Has anybody realy changed brightness or other capabilities? I still can’t do that 🙁
Here is how I set the brightness :
TwCapability bright = new TwCapability(TwCap.ICAP_BRIGHTNESS, (short)brightness, TwType.Fix32);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, bright);
if (rc != TwRC.Success)
{
CloseSrc();
return;
}
where ICAP_BRIGHTNESS = 0x1101.Let me know if it works for you.
ferro, Thanks.
I used your code and changed brightness. But I saw one interesting thing: I set different values for short brightness, but reseive only three levels of this capability: dark(brightness < 20), normal(20) and light(>20). How can I get more graduations? May it be, that the reason is in code from constructor of TwCapability?Hello, ferro!
What can you tell about ICAP_PIXELTYPE capability? After your advice I could change brightness, but I still get error when try to set ICAP_PIXELTYPE.- AuthorPosts