1 #include <lib/gui/epixmap.h>
2 #include <lib/gdi/epng.h>
3 #include <lib/gui/ewidgetdesktop.h>
5 ePixmap::ePixmap(eWidget *parent)
6 :eWidget(parent), m_alphatest(false)
10 void ePixmap::setAlphatest(bool alphatest)
12 m_alphatest = alphatest;
15 void ePixmap::setPixmap(gPixmap *pixmap)
18 event(evtChangedPixmap);
21 void ePixmap::setPixmapFromFile(const char *filename)
23 loadPNG(m_pixmap, filename);
26 getDesktop()->makeCompatiblePixmap(*m_pixmap);
27 event(evtChangedPixmap);
30 int ePixmap::event(int event, void *data, void *data2)
36 ePtr<eWindowStyle> style;
40 // eWidget::event(event, data, data2);
42 gPainter &painter = *(gPainter*)data2;
44 painter.blit(m_pixmap, ePoint(0, 0), eRect(), m_alphatest?gPainter::BT_ALPHATEST:0);
48 case evtChangedPixmap:
52 return eWidget::event(event, data, data2);