示例#1
0
        public int TextWidth(Font f, string text)
        {
            int width = 0;

            foreach (char c in text)
            {
                CharStreamer cs = f.getChar(c);
                width += (int)cs.width;
            }
            return(width);
        }
示例#2
0
 public void WriteText(Font f, Point p, string text, bool color)
 {
     foreach (char c in text)
     {
         CharStreamer cs = f.getChar(c);
         if (p.X + cs.width > Lcd.Width)
         {
             break;
         }
         DrawBitmap(cs, p, cs.width, cs.height, color);
         p.X += (int)cs.width;
     }
 }
示例#3
0
文件: Lcd.cs 项目: RoninWest/monoev3
 public void WriteText(Font f, Point p, string text, bool color)
 {
     foreach(char c in text)
     {
         CharStreamer cs = f.getChar(c);
         if (p.X+cs.width > Lcd.Width)
             break;
         DrawBitmap(cs, p, cs.width, cs.height, color);
         p.X += (int)cs.width;
     }
 }
示例#4
0
文件: Lcd.cs 项目: RoninWest/monoev3
 public int TextWidth(Font f, string text)
 {
     int width = 0;
     foreach(char c in text)
     {
         CharStreamer cs = f.getChar(c);
         width += (int)cs.width;
     }
     return width;
 }