Solved

Xor function behavior

Posted on 1997-08-28
2
551 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

14 Experts available now in Live!

Get 1:1 Help Now