int calcCheckSum(UnsafeBitmap ubmp, int x, int y) { int checksum = 0; for (int i = 0; i < charHeight; i++) { checksum = checksum << 1; if (ubmp.GetPixel(x, y + i).green == 255) { checksum += 1; } } return(checksum); }
public bool compare(UnsafeBitmap test, int x, int y, bool lineHasChar) { string excludeChars = ".-:_"; if (excludeChars.Contains(convertString) && (!lineHasChar)) return false; if ((y + ubm.Bitmap.Height) > test.Bitmap.Height) return false; if ((x + ubm.Bitmap.Width) > test.Bitmap.Width) return false; for (int j = 0; j < ubm.Bitmap.Width; j++) { for (int i = 0; i < ubm.Bitmap.Height; i++) { // we are comparing binary bitmaps, so comparing just the green bit is ok if (test.GetPixel(j + x, i + y).green != ubm.GetPixel(j, i).green) return false; } } return true; }
int calcCheckSum(UnsafeBitmap ubmp, int x, int y) { int checksum = 0; for (int i = 0; i < charHeight; i++) { checksum = checksum << 1; if (ubmp.GetPixel(x, y + i).green == 255) checksum += 1; } return checksum; }