diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-03-17 14:55:48 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-03-17 14:55:48 +0100 |
commit | d369bbe7164dd35e75a7bad9e7b5497512bb5fe9 (patch) | |
tree | e5077f726ffe80016f7609af4a84f548b06b6546 /plugingui/painter.cc | |
parent | 0f981dab5d477e82abe4b01f6477193707997f7d (diff) |
Added PNG loadin support through a new Image class.
Diffstat (limited to 'plugingui/painter.cc')
-rw-r--r-- | plugingui/painter.cc | 13 |
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 |