public HistogramSolver(string characterSet, int imageWidth, int imageHeight) { // Split the set of characters into a list charsSet = characterSet.ToCharStringList(); ExpectedWidth = imageWidth; ExpectedHeight = imageHeight; solver = new BitmapVectorCollection(); trainerWorker = new BackgroundWorker(); trainerWorker.DoWork += new DoWorkEventHandler(worker_DoWork); trainerWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); trainerWorker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged); trainerWorker.WorkerReportsProgress = true; testerWorker = new BackgroundWorker(); testerWorker.DoWork += new DoWorkEventHandler(testerWorker_DoWork); testerWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(testerWorker_RunWorkerCompleted); }
public override void Load(BinaryReader r) { base.Load(r); charsSet = r.ReadString().ToCharArray().ToList().Select(c => c.ToString()).ToList(); solver = BitmapVectorCollection.LoadFromFile(r); }