示例#1
0
        public void AddLine(string message = "")
        {
            _statusLines.Add(message);
            if (_statusLines.Count > _statusLineCount)
            {
                _statusLines.RemoveAt(0);
            }

            SGI sgi = _oledDisplay.SimpleGraphics;

            uint height = sgi.Height;
            uint width  = sgi.Width;

            if (_statusLines.Count == 1)
            {
                _statusLines.Add("DISPLAY x: " + width + ", y: " + height);
            }

            uint yStart = 88;

            sgi.DisplayRectangle(_statusBackgroundColor, 0, _statusBackgroundColor, 0, yStart, width, height - yStart);
            int lineNum = 0;

            foreach (string line in _statusLines)
            {
                uint lineY = (uint)(yStart + (lineNum * 10) - 2);
                sgi.DisplayText(line, _fontStatus, _statusColor, 0, lineY);
                lineNum++;
            }
        }
示例#2
0
        public void SetBody(string body)
        {
            _body = body;
            SGI sgi = _oledDisplay.SimpleGraphics;

            sgi.DisplayRectangle(_bodyBackgroundColor, 0, _bodyBackgroundColor, 0, 20, sgi.Width, 64);
            sgi.DisplayText(_body, _fontBody, _bodyColor, 0, 20);
        }
示例#3
0
        public void SetTitle(string title)
        {
            _title = title;
            SGI sgi = _oledDisplay.SimpleGraphics;

            sgi.DisplayRectangle(_titleBackgroundColor, 0, _titleBackgroundColor, 0, 0, sgi.Width, 16);
            sgi.DisplayText(_title, _fontTitle, _titleColor, 0, 0);
        }