TwainPRO 9 for .NET - User Guide > How To > Negotiate Capabilities > Set Image DPI |
Image Resolution can only be modified, or set, after a TWAIN Session has been opened (OpenSession), and prior to initiating the scanning session (StartSession).
|
One capability that is often set by the application is the desired DPI of the scanned image. To set the DPI for scanned images, use the TWAIN capabilities: ICAP_XRESOLUTION and ICAP_YRESOLUTION.
It is important to set the ICAP_UNITS capability equal to TWUN_INCHES prior to setting the resolution capabilities. |
C# Example |
Copy Code
|
---|---|
// This code demonstrates how to set the DPI of scanned images to 300 DPI Accusoft.TwainProSdk.CapabilityContainerOneValueFloat myCap = new CapabilityContainerOneValueFloat(Capability.IcapUnits); myCap.Value = (float)Accusoft.TwainProSdk.CapabilityConstants.TwunInches; twainDevice.SetCapability(myCap); myCap = new CapabilityContainerOneValueFloat(Capability.IcapXResolution); myCap.Value = 300; twainDevice.SetCapability(myCap); myCap = new CapabilityContainerOneValueFloat(Capability.IcapYResolution); myCap.Value = 300; twainDevice.SetCapability(myCap); |