/* * private void addCalibrationImageToDebug(string text, int fontSize) * { * Bitmap b = new Bitmap(200, 30); * using (Graphics g = Graphics.FromImage(b)) * { * g.FillRectangle(Brushes.Black, 0, 0, b.Width, b.Height); * int x = 0; * foreach (char c in text) * { * g.DrawImage(alphabets[fontSize][c], x, 5); * x += alphabets[fontSize][c].Width + 3; * } * } * AddBitmapToDebug(b); * } */ /* * // used for debugging. can be commented out for release * static public void saveLetterArrayToFile(uint[] array, string file) * { * Bitmap debugImg = new Bitmap(36, 36); * using (Graphics g = Graphics.FromImage(debugImg)) * using (Font font = new Font("Arial", 8)) * { * g.FillRectangle(Brushes.DarkGray, 0, 0, debugImg.Width, debugImg.Height); * * for (int y = 0; y < array.Length - 1; y++) * { * uint row = array[y + 1]; * int x = 0; * while (row > 0) * { * if ((row & 1) == 1) * g.FillRectangle(Brushes.White, x, y, 1, 1); * row = row >> 1; * x++; * } * } * debugImg.Save(file); * } * } */ internal void setOCRControl(OCRControl ocrControlObject) { _ocrControl = ocrControlObject; }
/* * private void addCalibrationImageToDebug(string text, int fontSize) * { * Bitmap b = new Bitmap(200, 30); * using (Graphics g = Graphics.FromImage(b)) * { * g.FillRectangle(Brushes.Black, 0, 0, b.Width, b.Height); * int x = 0; * foreach (char c in text) * { * g.DrawImage(alphabets[fontSize][c], x, 5); * x += alphabets[fontSize][c].Width + 3; * } * } * AddBitmapToDebug(b); * } */ /* * // used for debugging. can be commented out for release * static public void saveLetterArrayToFile(uint[] array, string file) * { * Bitmap debugImg = new Bitmap(36, 36); * using (Graphics g = Graphics.FromImage(debugImg)) * using (Font font = new Font("Arial", 8)) * { * g.FillRectangle(Brushes.DarkGray, 0, 0, debugImg.Width, debugImg.Height); * * for (int y = 0; y < array.Length - 1; y++) * { * uint row = array[y + 1]; * int x = 0; * while (row > 0) * { * if ((row & 1) == 1) * g.FillRectangle(Brushes.White, x, y, 1, 1); * row = row >> 1; * x++; * } * } * debugImg.Save(file); * } * } */ internal void setOCRControl(ocr.OCRControl ocrControlObject) { ocrControl = ocrControlObject; }