Exemple #1
0
        public virtual Canvas Copy()
        {
            Canvas canvas = new MemoryCanvas(this.Size);

            canvas.Set(Point.Empty, this);
            return(canvas);
        }
Exemple #2
0
        public virtual Canvas Copy(Rectangle rect)
        {
            Canvas canvas = new MemoryCanvas(rect.Size);

            canvas.Set(new Point(0, 0), rect, this);
            return(canvas);
        }
Exemple #3
0
        public virtual Canvas Rotate(TranslateCharacter translate = null)
        {
            var mc = new MemoryCanvas(new Size(Height, Width));

            for (int y = 0; y < mc.Height; y++)
            {
                for (int x = 0; x < mc.Width; x++)
                {
                    var val = this[y, x];
                    if (translate != null)
                    {
                        val.Character = translate(val.Character);
                    }
                    mc[mc.Width - x - 1, y] = val;
                }
            }
            return(mc);
        }