Ejemplo n.º 1
0
        internal void PrepareGameSize(int width, int height)
        {
            lock (_lock)
            {
                _rgba15  = new Mat(height, width, CvType.Cv8uc4);
                _cells15 = new Mat[GridArea];

                for (int i = 0; i < GridSize; i++)
                {
                    for (int j = 0; j < GridSize; j++)
                    {
                        int k = i * GridSize + j;
                        _cells15[k] = _rgba15.Submat(i * height / GridSize, (i + 1) * height / GridSize, j * width / GridSize, (j + 1) * width / GridSize);
                    }
                }

                for (int i = 0; i < GridArea; i++)
                {
                    var s = Imgproc.GetTextSize((i + 1).ToString(), 3 /* CV_FONT_HERSHEY_COMPLEX */, 1, 2, null);
                    _textHeights[i] = (int)s.Height;
                    _textWidths[i]  = (int)s.Width;
                }
            }
        }