I am trying to draw in 'layers' but the code is not exactly doing what I intended.
Here is the input to the program (always png/bmp) What I want it to do is draw the line BEHIND the text. I think the way I do this is with the following steps (I could be wrong)
1. Load the image (always a white background / black(dark) text)
2. Make the background transparent
3. Draw the background (white)
4. Draw the line
5. Draw the text
Here is the code but the line is not under the text (it is drawn on top)
Code: Select all
wxBitmap bmp(463, 105, 32);
wxMask *pmask = new wxMask(bmp, wxColour(255, 255, 255));
bmp.SetMask(pmask);
bmp.LoadFile("Input.png"); // , wxBITMAP_PNG());
wxMemoryDC memDC(bmp);
memDC.SetBackground(*wxTRANSPARENT_BRUSH);
memDC.SetBackgroundMode(wxTRANSPARENT);
memDC.SetPen(*wxRED_PEN);
memDC.DrawLine(25, 61, 427, 61); // for testing purposes
memDC.SelectObject( wxNullBitmap );
bmp.SaveFile("TestOutput.png", wxBITMAP_TYPE_PNG);
Actual Output:
Target Output: