Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!esvax.berkeley.edu!bchen From: bchen@esvax.berkeley.edu (Benjamin Chen) Newsgroups: comp.windows.x Subject: Help with Drawing Pixmaps using Xlib Message-ID: <31687@ucbvax.BERKELEY.EDU> Date: 4 Oct 89 02:30:32 GMT Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: bchen@esvax.berkeley.edu (Benjamin Chen) Organization: University of California, Berkeley Lines: 43 I'm having tremendous difficulty in drawing a Pixmap to a window! Basically, I set up my gc like this: 1) Set the clipmask to the pixmap to be displayed. 2) Set the clip origin to the coordinates where I want the pixmap to be displayed. 3) Set the fill_style to FillSolid Then I call XFillRectangle using the gc to fill an area of the screen. The area is defined by the pixmap's width and height and the same coordinates as those used in the clip origin. Unfortunately, only a small diagonal of the window is affected by any of the draw commands! Here's the code, in case my explanation isn't clear: values.foreground = dotColor; values.clip_x_origin = sx; values.clip_y_origin = sy; if (gc) { XChangeGC(ez_Display, gc, GCForeground|GCClipXOrigin|GCClipYOrigin, &values); } else { values.clip_mask = ezSmallDotBitmap; values.fill_style = FillSolid; gc = (GC) XCreateGC(ez_Display, (Drawable) win, GCClipMask|GCFillStyle|GCForeground| GCClipXOrigin|GCClipYOrigin, &values); } XFillRectangle(ez_Display, (Drawable) win, gc, win, sx, sy, (unsigned int) small_dot_width, (unsigned int) small_dot_height); Can any one help, or point me to some sample code? I have the O'Reilly book volume 1 which explains the clip stuff, but the above code is basically the result of reading that part of the book. BC Benjamin Chen Office: 550-A4 Cory Hall, 2-4332 UUCP: !ucbvax!esvax!bchen HEPNET: LBL::"bchen@esvax.Berkeley.EDU"