how to set the wxPen color by using SetLogicalFunction

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
dhana
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Dec 02, 2014 7:25 am

how to set the wxPen color by using SetLogicalFunction

Post by dhana » Wed Feb 11, 2015 12:02 pm

Here, I draw a rectangle for the given text.

wxScreenDC dc;
dc.SetLogicalFunction(wxINVERT);
dc.SetPen (wxPen (wxColour(63 ,72,204), 2, wxSOLID));
dc.SetBrush (*wxTRANSPARENT_BRUSH);
dc.DrawText( _T("There should be no text below"), 110, 150 );
dc.DrawRectangle( 110, y, 100, height );

In above code,the color of pen displaying black always.
why its not updating?

Manolo
Can't get richer than this
Can't get richer than this
Posts: 713
Joined: Mon Apr 30, 2012 11:07 pm

Re: how to set the wxPen color by using SetLogicalFunction

Post by Manolo » Thu Feb 12, 2015 1:49 am

Pen and brush are used for lines or general drawing. Logical operations work with the current background. Perhaps you want to clear it first.
For text you need dc.SetTextBackground and dc.SetTextForeground.

Post Reply