Home › Forums › TWAIN Classic › Set X / YResolution returned TWRC_CHECKSTATUS! Fujitsu C# › Reply To: Set X / YResolution returned TWRC_CHECKSTATUS! Fujitsu C#
@gabe wrote:
try to set that cap with twacker. if twacker can’t do it either, then it isn’t your code – it is entirely possible that the scanner doesn’t support setting that cap to that value… If you send a get for xresolution you often get the allowed values for the set operation – try setting to one of the value you recieve from the get op.
I just tried to set xResolution cap with Twacker..and it worked. I think something wrong with the type?
In Twacker, the itemtype is TWTY_FIX32 and the value I set to 50 for X Resolution.
If the value set to XResolution must be TWTY_FIX32, for my app it is the TwFix32 object.
But, TwCapability() doesn’t take the twfix32 object as value. It only take the value in Short!
TwFix32 f32 = new TwFix32();
f32.FromFloat(50);
tc = new TwCapability(TwCap.XResolution, f32.Whole);
tc.ConType = (short)TwOn.One;
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, tc);
rc will return CheckStatus. But Twacker tell me that the value can be set to the scanner!! Other CAP are alright, except this one taking the TwFix32 .
I am not sure how to get the xresolution from the get op in the code. Can you give me a sample code?
@gabe wrote:
What do you have for units when you are trying to set the resolution?
And as with everything else, what is the condition code returned?
I tried to set the units to pixels and got success returned!
tc = new TwCapability(TwCap.IUnits, (short)TwUn.PIXELS);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, tc);