Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!snorkelwacker!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU (der Mouse) Newsgroups: comp.windows.x Subject: Re: pixmaps Message-ID: <9006091006.AA11777@Larry.McRCIM.McGill.EDU> Date: 9 Jun 90 10:06:57 GMT Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 32 > I need to create a pair of pixmaps( sensitive and insensensitive) for > a Motif button. The second pixmap will be just like the first, > except it should be stippled using the background color. To > accomplish this, I am calling XCreatePixmapFromBitmapData twice, with > the same data. Then I call XFillRectangle with the appropriate gc to > stipple the second pixmap. That's perfectly reasonable, though as you imply you've noticed, slightly inefficient (very inefficient if the thing is large). > I think I should be able to copy the first pixmap to the second ( > using memcpy or some other low level routine ) and then call > XFillRectangle on the new pixmap. The problem here is I don't really > know how much memory the pixmap occupies. There is a much more serious problem: in general, you, the client, do not have access to the memory occupied by the pixmap. All you have is an ID by which you identify the pixmap to the server in X requests. (I said "in general" because someone probably has a system where the client and server can use shared memory if they're on the same machine.) > It has also been suggested that I use XCreatePixmap and XCopyArea to > create the second pixmap. This is a much better way of doing it. It's the method I'd recommend. (Ie, XCreatePixmapFromBitmapData, XCreatePixmap, XCopyArea, XFillRectangle (plus some GC setup calls).) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu