home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!mouse
- From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
- Newsgroups: comp.windows.x
- Subject: Re: Initializing Bitmap's
- Keywords: PIXMAP, BITMAP GC
- Message-ID: <1992Nov20.095641.20594@thunder.mcrcim.mcgill.edu>
- Date: 20 Nov 92 09:56:41 GMT
- References: <1eem4rINNl0c@uwm.edu>
- Organization: McGill Research Centre for Intelligent Machines
- Lines: 25
-
- In article <1eem4rINNl0c@uwm.edu>, amit@point.cs.uwm.edu (Amit Srivastava) writes:
-
- > Is there way to initialize a bitmap to say all 0's, [...]
-
- The (R4) Xlib document says, in part:
-
- 6.1. Clearing Areas
-
- Xlib provides functions that you can use to clear an area or
- the entire window. Because pixmaps do not have defined
- backgrounds, they cannot be filled by using the functions
- described in this section. Instead, to accomplish an analogous
- operation on a pixmap, you should use XFillRectangle, which
- sets the pixmap to a known value.
-
- [...describes XClearArea and XClearWindow...]
-
- So just set up a GC to get 0s in the destination drawable (eg,
- foreground=0 and function=GXcopy, or foreground=~0 and
- function=GXandInverted) and do an XFillRectangle of the whole pixmap.
-
- der Mouse
-
- mouse@larry.mcrcim.mcgill.edu
-