Path: utzoo!attcan!uunet!seismo!sundc!pitstop!texsun!sun-barr!rutgers!apple!bloom-beacon!EXPO.LCS.MIT.EDU!rws From: rws@EXPO.LCS.MIT.EDU Newsgroups: comp.windows.x Subject: Re: Bitmap Image/XPutImage Question Message-ID: <8904281203.AA02465@expire.lcs.mit.edu> Date: 28 Apr 89 12:03:04 GMT References: <3033@hound.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 16 XImage *image; image=XCreateImage( dpy, visual, 1, XYBitmap, 0, (char *)the_bitmapbits, width, height, 8, (width/8) ); You want (width + 7) / 8. But also, this call will set bitmap attributes based on the display rather than based on the source image. This is a defect in the Xlib interface; you'll want to smash values in the image after you create it. XPutImage( dpy, mywin, gc, image, 0,0, 50,50, width, height ); XMapWindow( dpy, mywin ); You can't expect to put graphics into an unmapped window, and then map it, and expect the graphics to appear. Do not pass Go, return to your favorite X book's explanation of mapping/exposure/redraw mechanics.