Discussion:
background color for dashed line
(too old to reply)
Ram Baruch
2004-06-13 13:58:54 UTC
Permalink
Hi,
I'm calling CPen::CreatePen() and passing PS_DASH (white color). My
background is black BUT the line I draw (using the CPen object) is drawn on
an existing WHITE line. As a result, I cannot see the new dashed line
(because it doesn't draw anything between the small lines so I see only one
solid line).
I know that I can draw two lines- one black and one dashed white, but the
question is if I can draw only one dashed line so that between the white
small lines it will draw black lines?
Regards,
Ram.
Johan Rosengren
2004-06-13 13:49:19 UTC
Permalink
Ram,

If memory serves, the color set in SetBkColor will be used by the background
of the dashed lines as well. SetBkMode( TRANSPARENT ) will definitely set
the mode to transparent, anyway :-). If my brain has finally collapsed under
the burden of all thinking, you might try selecting a brush into the CDC
with the desired color.

Johan Rosengren
Abstrakt Mekanik AB
Post by Ram Baruch
Hi,
I'm calling CPen::CreatePen() and passing PS_DASH (white color). My
background is black BUT the line I draw (using the CPen object) is drawn on
an existing WHITE line. As a result, I cannot see the new dashed line
(because it doesn't draw anything between the small lines so I see only one
solid line).
I know that I can draw two lines- one black and one dashed white, but the
question is if I can draw only one dashed line so that between the white
small lines it will draw black lines?
Regards,
Ram.
Ram Baruch
2004-06-13 15:16:39 UTC
Permalink
Hi,
Yes- you're absolutely right! thanks!
Ram.
Post by Johan Rosengren
Ram,
If memory serves, the color set in SetBkColor will be used by the background
of the dashed lines as well. SetBkMode( TRANSPARENT ) will definitely set
the mode to transparent, anyway :-). If my brain has finally collapsed under
the burden of all thinking, you might try selecting a brush into the CDC
with the desired color.
Johan Rosengren
Abstrakt Mekanik AB
Post by Ram Baruch
Hi,
I'm calling CPen::CreatePen() and passing PS_DASH (white color). My
background is black BUT the line I draw (using the CPen object) is drawn
on
Post by Ram Baruch
an existing WHITE line. As a result, I cannot see the new dashed line
(because it doesn't draw anything between the small lines so I see only
one
Post by Ram Baruch
solid line).
I know that I can draw two lines- one black and one dashed white, but the
question is if I can draw only one dashed line so that between the white
small lines it will draw black lines?
Regards,
Ram.
Loading...