Пример #1
0
        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));
        }
Пример #2
0
        public string GetRgbAtWindowCoordinate(int windowRow, int windowCol)
        {
            var symbol = GetSymbolAtWindowCoordinate(windowRow, windowCol);

            return(StitchLookup.RgbFromSymbol(symbol));
        }