Hi,
I'm currently writing my own plugin (VDR 1.3.37) using - cBitmap::LoadXpm() to load a bitmap and - cOsd::DrawBitmap() to draw it with changed background color (NOT changed foreground color).
Because I neither want to change the foreground color nor know the foreground color value (tColor), I think it is good to change this part in cPalette::Take() (osd.c line 77-82):
if (ColorFg || ColorBg) { switch (i) { case 0: Color = ColorBg; break; case 1: Color = ColorFg; break; } }
to
if (i == 0 && ColorBg) Color = ColorBg; if (i == 1 && ColorFg) Color = ColorFg;
Eike
Eike Edener wrote:
Because I neither want to change the foreground color nor know the foreground color value (tColor), I think it is good to change this part in cPalette::Take() (osd.c line 77-82): to
if (i == 0 && ColorBg) Color = ColorBg; if (i == 1 && ColorFg) Color = ColorFg;
I think the reason for the (ColorFg || ColorBg) test is that a black color cant be set with your code, and the VDR test only ignores to set colors if foreground AND background color is black.
Imho you can just pass on the color you don't want to change, eg. like this:
cOsd::DrawBitmap(x,y,bitmap,bitmap.Color(1),myBackground,replace)
Cheers,
Udo