/* * LoadBits * -------- * This program loads a bitmap from a file using the loadbitmap function, * then displays it on a window using the copyrect function. */ #include bitmap b = NULL; void draw_window(window w, rect win_rect) { rect r; if (b) { r = getrect(b); copyrect(b, pt(5,5), r); } } void main(void) { window w; w = newwindow("Loading a Bitmap", rect(0,0,200,200), StandardWindow); b = loadbitmap("working.xbm"); if (b == NULL) printf("Sorry, couldn't load that bitmap.\n"); setredraw(w, draw_window); show(w); mainloop(); }