I have created a wxDialog and use SetFullscreen(true) and SetTransparent(0), to make a transparent fullscreen window.
Now i try to draw a rectangle on it.
<code>
void myClass::OnPaint(wxPaintEvent &event)
{
wxPaintDC dc(this);
wxBrush brush(255,0,0),
dc.SetBrush(brush);
dc.DrawRectangle(0,0,400,400);
}
</code>
But i can't see the rectangle. If i delete SetTransparent(0) the rectangle will be drawn correct but the background isn't transparent :-/
Any idea how to solve this problem ?
Drawing on a transparent Fullscreen Dialog
-
- wxWorld Domination!
- Posts: 1059
- Joined: Sun Dec 30, 2007 6:40 pm
- Location: Canada
If you're using Windows, you can catch the wxEraseEvent with an empty function( thanks to lvdlinden teaching me that one).
Jim
Code: Select all
void OnErase( wxEraseEvent &e )
{
// do not clear background
}
OS: Vista SP1, wxWidgets 2.8.7.