Solved

Using OWL's DrawText function

Posted on 1997-10-27
3
328 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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 viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now