Solved

Using OWL's DrawText function

Posted on 1997-10-27
3
355 Views
Last Modified: 2012-08-14
I used DrawText function to write some text on a specific DC on my client window.
Now I want to erase that text only by giving a reference to the DC.
I used SetROP2( R2_NOTXORPEN ) an it works with rectangles, for example, but not with DrawText.

How should I do it? And why does it not work the other way ?
0
Comment
Question by:sagitarian
3 Comments
 
LVL 2

Accepted Solution

by:
JensUniweb earned 150 total points
ID: 1172119
I'm not 100% sure but the text functions does not use the pen. You use SetTextColor(). And there you can not set the NOTXOR. What you can do is write the text to a DC in memory and use BitBlt() to copy the text into your normal DC. And there you can use mask and so to get the effect you want. I could get you some example code. But not today.
0
 

Author Comment

by:sagitarian
ID: 1172120
I'm definitly sure that text functions do not use the pen. I tried to change the pen color and text still came out in black.
About the SetTextColor() function, I end up with another problem I have which is to find out the way to get the system background color. If I could do that, it would be simple.
The BitBlt() function seems to be more complicated and would need an example.

Thanks very much for the answer!
0
 

Expert Comment

by:zaWasp
ID: 7886438
hmm, I have a similar question. In my app, I have a splitter, and I want to display the splitting percentage between two panels, using DrawText (or TextOut), right beside the mouse cursor. However, when I move the mouse, the text written at previous cursor position is not erased. How can I do that?
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question