From 1917182efa2d47eb107d97041abea2385ffd33ee Mon Sep 17 00:00:00 2001 From: mrwastl Date: Sun, 17 Mar 2013 10:06:59 +0100 Subject: showpic: fix rendering bug --- tools/showpic/showpic.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/showpic/showpic.c b/tools/showpic/showpic.c index 5df19f8..1c6e213 100644 --- a/tools/showpic/showpic.c +++ b/tools/showpic/showpic.c @@ -10,7 +10,7 @@ * to the COPYING file distributed with this package. * * (c) 2004-2010 Andreas Regel - * (c) 2010-2011 Wolfgang Astleitner + * (c) 2010-2013 Wolfgang Astleitner * Andreas 'randy' Weinberger */ @@ -214,6 +214,8 @@ int main(int argc, char *argv[]) GLCD::cGLCDFile glcd; GLCD::cExtFormatFile extformat; + GLCD::cBitmap * buffer = new GLCD::cBitmap(lcd->Width(), lcd->Height()); + int optFile; std::string picFile; @@ -234,8 +236,8 @@ int main(int argc, char *argv[]) lcd->Refresh(true); while ((bitmap = image.GetBitmap()) != NULL && !stopProgramm) { -// lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height(), bitmap->LineSize()); - lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height()); + buffer->DrawBitmap(0, 0, *bitmap); + lcd->SetScreen(buffer->Data(), buffer->Width(), buffer->Height()); lcd->Refresh(false); if (image.Next(0)) // Select next image @@ -257,6 +259,7 @@ int main(int argc, char *argv[]) optFile = optind; } + delete buffer; lcd->DeInit(); delete lcd; -- cgit v1.2.3