home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!centerline!noc.near.net!mars.caps.maine.edu!maine.maine.edu!michael
- Subject: Re: GXcopy and GXxor
- Organization: University of Maine System
- Newsgroups: comp.windows.x
- References: <xia.711911424@odin>
- Message-ID: <MICHAEL.920724095149@maine.maine.EDU>
- From: michael@maine.maine.edu (Michael Johnson)
- To: NETNEWS@MAINE
- Date: Fri, 24 Jul 92 09:51:49 EDT
- Lines: 21
-
- In article <xia.711911424@odin> xia@molbio.ethz.ch (Xia Tai-he) writes:
- >I have created a GC with function GXcopy and another GC with GXxor for
- >drawing rubber-band lines,
- >I also set the foreground colors for the two GCs. When I
- >draw lines with the first GC, I get the correct color.
- >However, the lines drawn with the second GC don't have
- >the color I have set, whose colors differ depending on the
- >objects alreay existing on the screen. Could you give
- >me a suggestion to get rid of it?
-
- There's not really much you can do about it. When you XOR the pixels, the
- resulting pixel value is going to yield whatever color that pixel maps to.
- Do you understand what an XOR operation is?
-
- I find that a useful value for rubber-banding with XOR is -1, cast to Pixel.
- This usually yields a consistent color (usually black, though I've seen cases
- where an application actually allocated pixels that high, resulting in a
- different color).
-
- Michael Johnson, VM Systems Group michael@maine.maine.edu
- "I will choose the path that's clear. I will choose Free Will." -- Neil Peart
-