From 0b8356aa927db1d536c00211a7d77fd2168d70dc Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 26 Feb 2011 12:13:59 +0100 Subject: Improved and cleaned up transparent text drawing --- PLUGINS/src/osddemo/osddemo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'PLUGINS') diff --git a/PLUGINS/src/osddemo/osddemo.c b/PLUGINS/src/osddemo/osddemo.c index 87d94638..2e6a33bf 100644 --- a/PLUGINS/src/osddemo/osddemo.c +++ b/PLUGINS/src/osddemo/osddemo.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: osddemo.c 2.2 2011/02/20 15:06:18 kls Exp $ + * $Id: osddemo.c 2.3 2011/02/26 12:08:13 kls Exp $ */ #include @@ -338,7 +338,8 @@ void cTrueColorDemo::Action(void) const int Size = Font->Width(Text) + 10; const int NumDots = 12; const int AnimFrames = NumDots; - AnimPixmap = osd->CreatePixmap(3, cRect((osd->Width() - Size) / 2, StartLine, Size, Size), cRect(0, 0, Size, Size * AnimFrames)); + // Temporarily using pixmap layer 0 to have the text alpha blended: + AnimPixmap = osd->CreatePixmap(0, cRect((osd->Width() - Size) / 2, StartLine, Size, Size), cRect(0, 0, Size, Size * AnimFrames)); if (AnimPixmap) { AnimPixmap->SetAlpha(0); AnimPixmap->Clear(); @@ -356,8 +357,9 @@ void cTrueColorDemo::Action(void) AnimPixmap->DrawEllipse(cRect(x, y, Diameter, Diameter), ArgbToColor(0xFF, Color, Color, Color)); Color -= Delta; } - AnimPixmap->DrawText(cPoint(0, Frame * Size), "Animation", clrBlack, clrTransparent, cFont::GetFont(fontSml), Size, Size, taCenter); + AnimPixmap->DrawText(cPoint(0, Frame * Size), Text, clrBlack, clrTransparent, cFont::GetFont(fontSml), Size, Size, taCenter); } + AnimPixmap->SetLayer(3); // now setting the actual pixmap layer FadeInPixmap = AnimPixmap; LOCK_THREAD; OldCursor = cursor = AnimPixmap->ViewPort().Point(); -- cgit v1.2.3