Hi Everyone:
I create a new Visual studio 2019 C# windows form to try Polimago Handwriting sample. I imported iCVCImg.dll, iPolimago.dll and iSil.dll . I build the project successfully, but when the program running it will has an exception when th program load classifier file(.pcc) and Sil File(.xsil). The exception is an attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B).
My Program is below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PolimagoTest
{
public partial class Form1 : Form
{
private Cvb.SharedPolimagoClf theClassifier_;// The Polimago classifier to be used.
private Cvb.SharedSil theSIL_;
public Form1()
{
InitializeComponent();
LoadClassifier(@"%CVB%\Tutorial\Polimago\Images\Handwriting\USDigits6000.pcc");
LoadSampleList(@"%CVB%\Tutorial\Polimago\Images\Handwriting\TestDigits.xsil");
}
private void LoadClassifier(string fileName)
{
try
{
Cvb.SharedPolimagoClf tmp = Cvb.Polimago.OpenClf(fileName);
if (tmp != null)
{
theClassifier_ = tmp;
Console.WriteLine("Loaded classifier '" + fileName + "'");
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
private void LoadSampleList(string fileName)
{
try
{
Cvb.SharedSil tmp = null;
Cvb.Sil.Load(fileName, out tmp);
if (tmp != null)
{
theSIL_ = tmp;
Console.WriteLine("Loaded sample image list '" + fileName + "'");
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}///////////////////////////////////////////////////////////////////
}