public static Pattern LoadFromBitmap(Bitmap img) { var symbols = new string[img.Height, img.Width]; for (int r = 0; r < img.Height; r++) { for (int c = 0; c < img.Width; c++) { Color pixelColor = img.GetPixel(c, r); string symbol = StitchLookup.SymbolFromRgb(pixelColor); symbols[r, c] = symbol; } } return(new Pattern(symbols)); }
public string GetRgbAtWindowCoordinate(int windowRow, int windowCol) { var symbol = GetSymbolAtWindowCoordinate(windowRow, windowCol); return(StitchLookup.RgbFromSymbol(symbol)); }