From fc0094231d3f803869b8a03f449092b9464b2c21 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 4 Jan 2015 15:53:47 +0100 Subject: Added cOsd::DrawScaledBitmap() --- osd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'osd.c') diff --git a/osd.c b/osd.c index 7e527820..0532c0a8 100644 --- a/osd.c +++ b/osd.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.c 3.2 2013/09/03 11:59:17 kls Exp $ + * $Id: osd.c 3.3 2015/01/04 15:46:39 kls Exp $ */ #include "osd.h" @@ -1917,6 +1917,16 @@ void cOsd::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, tColo } } +void cOsd::DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias) +{ + const cBitmap *b = &Bitmap; + if (!DoubleEqual(FactorX, 1.0) || !DoubleEqual(FactorY, 1.0)) + b = b->Scaled(FactorX, FactorY, AntiAlias); + DrawBitmap(x, y, *b); + if (b != &Bitmap) + delete b; +} + void cOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment) { if (isTrueColor) -- cgit v1.2.3