Using Xor pen to get a certain color 
Author Message
 Using Xor pen to get a certain color

Hey graphics experts,

I want to draw a RED (&HFF) line on a Picture Box (pic), using an Xor
pen.

I set the BackColor of the Picture Box to &HFFFFFF (WHITE)

I set the DrawMode to 7 (XOR_PEN)

I set pic.ForeColor to &HFFFF00 (WHITE Xor RED)

I draw a line, expecting it to come out &HFFFFFF Xor &HFFFF00, or &HFF,
but it doesn't look &HFF.  It just isn't as bright as my other reds.

What am I doing wrong?

Am I wrong to assume that the Xor pen draws a color equivalent to
pic.BackColor Xor pic.ForeColor?

Thanks :)

--

Phil Nery
Dataform

WWW:     http://www.*-*-*.com/
voice:  310-374-1378



Fri, 13 Nov 1998 03:00:00 GMT  
 Using Xor pen to get a certain color

Quote:

>I want to draw a RED (&HFF) line on a Picture Box (pic), using an Xor
>pen.
>I set the BackColor of the Picture Box to &HFFFFFF (WHITE)
>I set the DrawMode to 7 (XOR_PEN)
>I set pic.ForeColor to &HFFFF00 (WHITE Xor RED)
>I draw a line, expecting it to come out &HFFFFFF Xor &HFFFF00, or &HFF,
>but it doesn't look &HFF.  It just isn't as bright as my other reds.
>Am I wrong to assume that the Xor pen draws a color equivalent to
>pic.BackColor Xor pic.ForeColor?

In 24-bit colour, this works the way you would expect (white Xor cyan = red).  
In 256-colour mode, it's the palette indices (not the RGB values) that are
Xor'd, so the result is dependent on how the palette is organized.

-----
J. Bodie



Fri, 13 Nov 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Changing Color of a Pen Object?

2. Pen Aware Applications on Non Pen Machines

3. Getting the palette color of a system color

4. Getting the palette color of a system color

5. Problem with overflow using XOR

6. Using Xor to compare two strings

7. Help using a Pen Tablet to capture signatures in VB needed

8. Example for using Xor and Line Methods?

9. Q: Using hardware button for pen click

10. Color text for certain records through VBA

11. Making data in variable a certain color, and printing a file

12. Retrieving the color of pixels of certain coordinates in a picture box

 

 
Powered by phpBB® Forum Software