Solved

Xor function behavior

Posted on 1997-08-28
2
563 Views
Last Modified: 2013-11-20
I am using the Xor function behavior in a device context with the following method: CDC::SetROP2(XORPEN). It works quite well as far as drawing lines is concerned, but doesn't work with  text.
My problem is that I want this behavior for a line and a text simultaneously. How is it possible?
Thanks, Nicolas,
0
Comment
Question by:Nicolas060297
2 Comments
 
LVL 1

Accepted Solution

by:
belov earned 100 total points
ID: 1305030
You cannot alter text output using SetRop2.
You may want to call PatBlt function with
PATINVERTand approapriate brush selected
into that device context after drawing text and line.

0
 

Author Comment

by:Nicolas060297
ID: 1305031
I have tried to use the PatBlt function, but it doesn't work.What I have tried to do is :            
MyObject::Draw(CDC* pDC)
{
....
CBrush myBrush = pDC->SelectBrush(backgroundBrush);
CSize      TextSize = pDC->GetTextExtent(myText);
pDC->TextOut(x,y, myText);
pDC->PatBlt(x,y,TextSize.cx,TextSIze.cy,PATINVERT)
}
The function Draw is called twice : one for drawing, one for erasing, and it doesn't work properly
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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