summaryrefslogtreecommitdiff
path: root/plugingui/painter.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-03-17 14:55:48 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-03-17 14:55:48 +0100
commitd369bbe7164dd35e75a7bad9e7b5497512bb5fe9 (patch)
treee5077f726ffe80016f7609af4a84f548b06b6546 /plugingui/painter.cc
parent0f981dab5d477e82abe4b01f6477193707997f7d (diff)
Added PNG loadin support through a new Image class.
Diffstat (limited to 'plugingui/painter.cc')
-rw-r--r--plugingui/painter.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugingui/painter.cc b/plugingui/painter.cc
index ce88333..40d6112 100644
--- a/plugingui/painter.cc
+++ b/plugingui/painter.cc
@@ -383,6 +383,19 @@ void GUI::Painter::drawImage(int x0, int y0, struct __img__ * img)
}
}
+void GUI::Painter::drawImage(int x0, int y0, GUI::Image *image)
+{
+ size_t fw = image->width();
+ size_t fh = image->height();
+
+ for(size_t x = 0; x < fw; x++) {
+ for(size_t y = 0; y < fh; y++) {
+ GUI::Colour c = image->getPixel(x, y);
+ pixbuf->setPixel(x0 + x, y0 + y, c.red, c.green, c.blue, c.alpha);
+ }
+ }
+}
+
void GUI::Painter::flush()
{
#ifdef X11