Home › Forums › TWAIN Classic › Get DPI ?
- This topic has 3 replies, 4 voices, and was last updated 16 years, 9 months ago by Anonymous.
- AuthorPosts
Hi,
I am making a program using scanner; my trouble is that I am not able to get DPI that was set by user in User Interface.I am able to set the resolution by source.setixresolution(X), but when the value is changed by user in the UI dialog to Y, twain still returns X (the value I have set).
When I try to unload and reload the source, it gives me 75 dpi (default value).
So my quest is, when user sets the DPI, how can I get it?
Second thing, twain doesn’t respond when asked for bitdepth (ICAP_BITDEPTH), does anyone know why?
Thanks a lot.
I have a Problem, that i have no idea how to set the resolution. Maybe you can post your code. (The method: setIXresolution())
thx Flo
I write my progrem in C#. I Changed resolution in this way:
TwRC rc;
TwCapability tc;
TwFix32 f32 = new TwFix32();
f32.FromFloat(100);//value of DPI
tc = new TwCapability(TwCap.Xresolution, f32);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, tc);
if (rc != TwRC.Success) {
CloseSrc();
return false;
}f32.FromFloat(100);
tc = new TwCapability(TwCap.Yresolution, f32);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, tc);
cc = DScapcc(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, tc);
if (rc != TwRC.Success) {
CloseSrc();
return false;
}@Victor wrote:
I write my progrem in C#. I Changed resolution in this way:
TwRC rc;
TwCapability tc;
TwFix32 f32 = new TwFix32();
f32.FromFloat(100);//value of DPI
tc = new TwCapability(TwCap.Xresolution, f32);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, tc);
if (rc != TwRC.Success) {
CloseSrc();
return false;
}Dude! That doesn’t work..
tc = new TwCapability(TwCap.Xresolution, f32);
TwCapability only takes short value??
- AuthorPosts