Link to home
Start Free TrialLog in
Avatar of Nicolas060297
Nicolas060297

asked on

Xor function behavior

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,
ASKER CERTIFIED SOLUTION
Avatar of belov
belov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nicolas060297
Nicolas060297

ASKER

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