Logo Search packages:      
Sourcecode: vdr-plugin-sudoku version File versions  Download package

void Bitmap::text ( const char *  text,
bool  centered = true 
)

Write a text into the bitmap.

Definition at line 36 of file bitmap.cpp.

References frame().

Referenced by SudokuPlugin::Menu::paint().

{
  DrawRectangle(0, 0, Width() - 1, Height() - 1, clrWhite);
  frame(0, 0, Width() - 1, Height() - 1, clrRed);
  const cFont* font = cFont::GetFont(fontOsd);
  cTextWrapper wrapper(text, font, Width());
  int y = max((Height() - wrapper.Lines() * font->Height()) / 2, 0);
  for (int l = 0; l < wrapper.Lines(); ++l, y += font->Height())
  {
    int x = 0;
    if (centered)
      x = max((Width() - font->Width(wrapper.GetLine(l))) / 2, 0);
    DrawText(x, y, wrapper.GetLine(l), clrBlack, clrWhite, font);
  }
}


Generated by  Doxygen 1.6.0   Back to index