Reputation: 57
The problem I'm facing is that when I scan a A4 size page with a WIA based C# windows form application, the scanned image has grey on the sides. The scanner is automatic document feeder. Any help in this regard will be helpful?
private void SetupPageSize(Device wia, bool rotatePage, PageSize pageSize, int DPI, WIA.Item item)
{
//Setup Page Size Property
foreach (WIA.Property itemProperty in item.Properties)
{
if (itemProperty.Name.Equals("Horizontal Resolution"))
{
((IProperty)itemProperty).set_Value(DPI);
}
else if (itemProperty.Name.Equals("Vertical Resolution"))
{
((IProperty)itemProperty).set_Value(DPI);
}
else if (itemProperty.Name.Equals("Horizontal Extent"))
{
double extent = DPI * pageSize.Height;
if (rotatePage)
{
extent = DPI * pageSize.Width;
}
//extent = 1250;
//extent = 1230;
((IProperty)itemProperty).set_Value(extent);
}
else if (itemProperty.Name.Equals("Vertical Extent"))
{
double extent = DPI * pageSize.Width;
if (rotatePage)
{
extent = pageSize.Height * DPI;
}
Console.WriteLine("vertical extent:" + extent);
//extent = extent + 500;
//extent = 1750;
((IProperty)itemProperty).set_Value(extent);
}
}
}
Upvotes: 1
Views: 931