R2_XORPEN does not work with polyline()?

R2_XORPEN does not work with polyline()?

Post by Rong X » Sat, 22 Nov 1997 04:00:00

Under Visual C++ 5.0, I use white pen to draw signal using polyline() on
a black background. The siganl that I get under R2_COPYPEN and R2_XORPEN
mode are different. The spikes of the signal disappear under R2_XORPEN

What is the reason for that? Is it because R2_XORPEN does not work with



1. Help with drawing polyline & not refreshing screen right!

Hi All,

        It's me again, the guy new programming for Windows with BC++ v4 and
OWL v2.  I have a question that I hope someone can answer.  I am trying
to draw neat shapes and things in my non-mdi main window.  I am using
the Paint function of the TWindows class to do some of the drawing, but
I find that I need to do some manual drawing on my own, so I am using a
pointer to the TDC class, called DragDC.  I am wondering how I can clear
the screen of the stuff drawn with the DragDC pointer.  the Invalidate
function does not clear my screen, and I havent found another way in the
documentation or the examples.  Heres a general overview of my code:

class TMyWindow:TWindow
TDC* DragDC;    

TMyWindow::Paint(TDC& dc, ...)
dc.Polyline(points, 4);


for (i = 1; i < 100; i++);

//function calls which change the values of points included here

Invalidate();  // this has no effect on the appearance of the
                // window, i.e. it does not clear it, nor does
                // it generate a WM_PAINT message.
                // So I am forced to draw manually, using
                // the next 3 lines.

DragDC = new TDragDC(*this);
delete DragDC;

This code draws a 100 copies of the Polyline on top of each other, and
then they are all
deleted and a final one is drawn by the paint function.

I guess the are two potential ways to solve this problem.  One would be
to call the Paint function from inside the for loop, but I don't know
how to do that.  The second would be to clear the screen within the for
loop, but I haven't been able to do that either.  When exactly does
windows generate the WM_PAINT message?  I thought it did whenever
Invalidate was called, but apparently not, or this code should work.
Sorry to be asking such an elementary question, but I am waiting for
some better references to arrive in the mail which will hopefully aid me
in my plight.

Thanks alot.



| U of MN-Morris|  (612)324-2566                | Rt 1 Box 1702    |
| UMM # 243     | Programmers don't bleed blood | Chokio, MN       |
| Morris,MN     |  They bleed binary...         | 56221            |
| 56267         |     - Inspired by S. Levy     |                  |

2. midi lighting controller

3. Algorithm that works under DOS but not in Windows

4. Resume's in TeX

5. A code works in Win95 & DOS, not int Win3.1

6. ftp berkeley?

7. DOS rename not working

8. Find window disappears off the screen in Acrobat Reader 4.0

9. Working TV card but MS Video Control is not working...sigh...

10. ExtCreatePen does not work in Windows 2000 but works in Windows 98

11. WSASetService () not working right (programmer not understand right?)

12. drivers not working in intel 810 chipset which are working in other chipset

13. CONNECT() Does Not WORK! Not timing out