home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / windows / x / 19379 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.2 KB

  1. Path: sparky!uunet!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!mouse
  2. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: Initializing Bitmap's
  5. Keywords: PIXMAP, BITMAP GC
  6. Message-ID: <1992Nov20.095641.20594@thunder.mcrcim.mcgill.edu>
  7. Date: 20 Nov 92 09:56:41 GMT
  8. References: <1eem4rINNl0c@uwm.edu>
  9. Organization: McGill Research Centre for Intelligent Machines
  10. Lines: 25
  11.  
  12. In article <1eem4rINNl0c@uwm.edu>, amit@point.cs.uwm.edu (Amit Srivastava) writes:
  13.  
  14. > Is there way to initialize a bitmap to say all 0's, [...]
  15.  
  16. The (R4) Xlib document says, in part:
  17.  
  18.     6.1.  Clearing Areas
  19.     
  20.     Xlib provides functions that you can use to clear an area or
  21.     the entire window.  Because pixmaps do not have defined
  22.     backgrounds, they cannot be filled by using the functions
  23.     described in this section.  Instead, to accomplish an analogous
  24.     operation on a pixmap, you should use XFillRectangle, which
  25.     sets the pixmap to a known value.
  26.     
  27.     [...describes XClearArea and XClearWindow...]
  28.  
  29. So just set up a GC to get 0s in the destination drawable (eg,
  30. foreground=0 and function=GXcopy, or foreground=~0 and
  31. function=GXandInverted) and do an XFillRectangle of the whole pixmap.
  32.  
  33.                     der Mouse
  34.  
  35.                 mouse@larry.mcrcim.mcgill.edu
  36.