示例#1
0
        public void DrawHorizontalLine(AsciiPen pen, uint x, uint y, uint width)
        {
            var buffer = m_surface.GetBuffer();
            var stringIndex = 0;

            if (x >= m_surface.Width || y >= m_surface.Height) return;

            for (uint i = 0; i < width; i++)
            {
                var offsetX = i + x;
                if (offsetX >= m_surface.Width) break;

                var index = (y*m_surface.Width) + offsetX;

                buffer[index].Character = pen.String[stringIndex++ % pen.String.Length];
                buffer[index].Color = pen.Color;
            }

            var clipArea = m_surface.ClientRectangle.Intersect(new Rectangle(x, y, width, 1));

            m_surface.Invalidate(clipArea);
        }
示例#2
0
 public void DrawHorizontalLine(AsciiPen pen, Point location, uint width)
 {
     DrawHorizontalLine(pen, location.X, location.Y, width);
 }
示例#3
0
        private void DrawPoint(AsciiPen pen, uint x, uint y)
        {
            var buffer = m_surface.GetBuffer();

            if (x >= m_surface.Width || y >= m_surface.Height) return;

            var index = (y * m_surface.Width) +x;

            buffer[index].Character = pen.String[0];
            buffer[index].Color = pen.Color;

            m_surface.Invalidate(new Rectangle(x, y, 1, 1));
        }
示例#4
0
        public void DrawVerticalLine(AsciiPen pen, uint x, uint y, uint height)
        {
            var buffer = m_surface.GetBuffer();
            var stringIndex = 0;

            if (x >= m_surface.Width || y >= m_surface.Height) return;

            for (uint i = 0; i < height; i++)
            {
                var offsetY = i + y;
                if (m_surface.Height <= offsetY) break;

                var index = (offsetY*m_surface.Width) + x;

                buffer[index].Character = pen.String[stringIndex++ % pen.String.Length];
                buffer[index].Color = pen.Color;
            }

            var clipArea = m_surface.ClientRectangle.Intersect(new Rectangle(x, y, 1, height));

            m_surface.Invalidate(clipArea);
        }
示例#5
0
 public void DrawVerticalLine(AsciiPen pen, Point location, uint height)
 {
     DrawVerticalLine(pen, location.X, location.Y, height);
 }
示例#6
0
 public void DrawPoint(AsciiPen pen, Point location)
 {
     DrawPoint(pen, location.X, location.Y);
 }