ref: 7e1b3f0d74ca29443d5c28c318a45831d0e6fc46
dir: /test.c/
#include <u.h> #include <libc.h> #include <draw.h> #include <event.h> Image *im; Image *bg; void eresized(int new) { getwindow(display, Refmesg); USED(new); Point p = {100,100}; draw(screen, screen->r, bg, 0, ZP); draw(screen, rectaddpt(screen->r, p), im, 0, ZP); flushimage(display, 1); } void main() { Event e; initdraw(0,0,"test"); einit(Ekeyboard); bg = allocimagemix(display, DRed, DWhite); im = readimage(display, open("glenda.im", OREAD), 0); eresized(0); for(;;){ eread(Ekeyboard, &e); if(e.kbdc == 'q') exits(0); } }