[vdr] Display right justified text

Klaus Schmidinger Klaus.Schmidinger at cadsoft.de
Mon Mar 14 13:45:11 CET 2005


Lars von Wedel wrote:
> 
> Hello,
> 
> I'd like to display right justified text in my plugin (using cOsdItem 
> and cSkinDisplayMenu::SetItem).
> 
> Is there any means to achieve this?
> 
> As an alternative, I would be satisifed with the number of characters 
> that can be displayed on a row so I could use a normal, left-justified 
> tab at a position "close" to the right of the OSD boundary.

How about looking into VDR/osd.h? ;-)

enum eTextAlignment { taCenter  = 0x00,
                       taLeft    = 0x01,
                       taRight   = 0x02,
                       taTop     = 0x04,
                       taBottom  = 0x08,
                       taDefault = taTop | taLeft
                     };

   void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width = 0, int Height = 0, int Alignment = taDefault);
        ///< Draws the given string at coordinates (x, y) with the given foreground
        ///< and background color and font. If Width and Height are given, the text
        ///< will be drawn into a rectangle with the given size and the given
        ///< Alignment (default is top-left). If ColorBg is clrTransparent, no
        ///< background pixels will be drawn, which allows drawing "transparent" text.


Klaus



More information about the vdr mailing list