Ejemplo n.º 1
0
        public Image(int tilesPerRow, ImageTile sampleTile)
        {
            this.sideLength = tilesPerRow * (sampleTile.Size - 2);

            for (int i = 0; i < this.sideLength; i++)
            {
                this.rows.Add(new char[this.sideLength]);
                this.originalRows.Add(new char[this.sideLength]);
            }
        }
Ejemplo n.º 2
0
        public void Insert(ImageTile image, int sampleX, int sampleY)
        {
            int refX = sampleX * (image.Size - 2);
            int refY = sampleY * (image.Size - 2);

            for (int y = 1; y <= image.Size - 2; y++)
            {
                var rowToCopy = image.GetRow(y);

                for (int x = 1; x <= image.Size - 2; x++)
                {
                    this.rows[refY + y - 1][refX + x - 1]         = rowToCopy[x];
                    this.originalRows[refY + y - 1][refX + x - 1] = rowToCopy[x];
                }
            }
        }