Solved

Xor function behavior

Posted on 1997-08-28
2
567 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
[X]
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
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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
Unix / Linux grid computing 5 168
Macro to save highlighted rows as a separate file 5 46
Complete beginner needs help making a cron job 9 129
countEvens challenge 2 113
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 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