using XOR for lines
Posted: Mon Sep 02, 2019 3:12 am
I am trying to figure out how to use wxXOR for lines. I took the test case from the sample at https://wiki.wxwidgets.org/WxDC and added some lines (The spam filter will not let me post the entire code):
On Fedora linux (with wxWidgets wxGTK3-3.0.4-8.fc30.x86_64) I compile it with:
If XOR was working as I expected it to, the lines would be drawn in yellow ( 0xffffff ^ 0x0000ff = 0xffff00) and the center of the X would be back to white. Instead I get a black X.
I am trying to understand what I am doing wrong.
Thank you.
Code: Select all
wxPen myPen = wxPen( wxT("blue"), 5, wxSOLID);
dc.SetPen(myPen);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.SetLogicalFunction(wxXOR);
dc.DrawLine(10, 20, 30, 40);
dc.DrawLine(30, 20, 10, 40);
Code: Select all
g++ draw.cpp -Wall `wx-config-3.0 --cxxflags --libs` -Wall -o draw
If XOR was working as I expected it to, the lines would be drawn in yellow ( 0xffffff ^ 0x0000ff = 0xffff00) and the center of the X would be back to white. Instead I get a black X.
I am trying to understand what I am doing wrong.
Thank you.