Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Xor function behavior

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 99
ODBC Connection Logging, ADO.NET 6 69
bigDiff challenge 17 123
Excel file not created as expected 7 79
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

790 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