At same time i was not able to get either function to work on window XP(32 and 64bit) machine.. I found that XP could not read WIA. When i going to create object like AutomationFactory.CreateObject("WIA.CommonDialog")), i got error as "No object was found registered for specified ProgID".
My code is,
try
{
using (dynamic CommonDialog = AutomationFactory.CreateObject("WIA.CommonDialog"))
{
dynamic imageFile = CommonDialog.ShowAcquireImage();
if (imageFile != null)
{
if (!Directory.Exists("D:\\ScanImage"))
{
Directory.CreateDirectory("D:\\ScanImage");
}
string filePath = string.Format("D:\\ScanImage\\{0}.jpg", Guid.NewGuid());
imageFile.SaveFile(filePath);
}
}
}
Thanks in advance.