[comp.windows.x] Best way to clear a PixMap?

kane@urbsdc.Urbana.Gould.COM (06/28/88)

What is the best way to clear an X11 bitmap?  The XClearArea
function only works on windows.  I guess I could use  XCopyPlane
to copy a blank pixmap into my pixmap...

Pat Kane
Gould CSD
Urbana, IL 

kane@xenurus.Gould.COM
usrsdc!kane

dschmidt@athena.mit.edu (Dan Schmidt) (06/28/88)

In article <60200002@urbsdc> kane@urbsdc.Urbana.Gould.COM writes:

 > What is the best way to clear an X11 bitmap?  The XClearArea
 > function only works on windows.  I guess I could use  XCopyPlane
 > to copy a blank pixmap into my pixmap...

Use XFillRectangle() with a GC whose function is GXclear.


+----------------------------+------------------------------------------------+
|          Dan Schmidt       |  Something I learned today                     |
|   dschmidt@athena.mit.edu  |  Black and white is always gray  -- Husker Du  |
+----------------------------+------------------------------------------------+

jim@EXPO.LCS.MIT.EDU (Jim Fulton) (06/28/88)

> What is the best way to clear an X11 bitmap?  The XClearArea
> function only works on windows.

The reason why XClearArea only works on windows is that pixmaps don't have
backgrounds, so the notion of "clearing to background" doesn't exist.  Set the
foreground of a GC to be the pixel value that you want replicated in the pixmap
and do XFillRectangle() with a alu function of GXcopy. 

Jim Fulton
MIT X Consortium