Example #1
0
        public Bitmap Process(Matrix matrix, InterpreterOptions options)
        {
            int height = (int)(matrix.Height * options.Scale);
            int width  = (int)(matrix.Width * options.Scale);

            // Set up the pen
            Pen = new Pen(options.Foreground)
            {
                Width = (float)options.Scale,
                Brush = new SolidBrush(options.Background)
            };

            var bitmap = new Bitmap(height, width);

            var g = Graphics.FromImage(bitmap);

            var matrixReader = new MatrixReader(matrix);

            while (matrixReader.MoveNext())
            {
                if (matrixReader.PeekCharacter() == matrixReader.NextSequentialCharacter)
                {
                    DrawPolygon(matrix, g, matrixReader.CurrentChar);
                }
                else
                {
                    DrawShape(matrix, g, matrixReader.CurrentChar);
                }
            }
            g.Flush();

            return(bitmap);
        }
Example #2
0
        public char PeekCharacter()
        {
            var internalReader = new MatrixReader(Matrix, CurrentChar);

            if (internalReader.MoveNext())
            {
                return(internalReader.CurrentChar);
            }
            return('\0');
        }