#include <wx/overlay.h>
Creates an overlay over an existing window, allowing for manipulations like rubber-banding, etc.
Overlay is implemented internally as a native window shown on top of the window it is used with and it is more efficient to keep the wxOverlay object around instead of recreating it every time it's needed, i.e. typically you would have a member variable of type wxOverlay in your window class.
The overlay is initialized automatically when it is used by wxDCOverlay or wxOverlayDC but has to be cleared manually, using its Reset() function, when its contents shouldn't be shown any longer.
Use of this class is shown in the Drawing Sample where pressing the left mouse button and dragging the mouse creates a rubber band effect using wxOverlay.
Public Member Functions | |
wxOverlay () | |
~wxOverlay () | |
void | Reset () |
Clears the overlay without restoring the former state. More... | |
void | SetOpacity (int alpha) |
Sets or unsets constant opacity of the overlay window. More... | |
wxOverlay::wxOverlay | ( | ) |
wxOverlay::~wxOverlay | ( | ) |
void wxOverlay::Reset | ( | ) |
Clears the overlay without restoring the former state.
To be done, for example, when the window content has been changed and repainted.
void wxOverlay::SetOpacity | ( | int | alpha | ) |
Sets or unsets constant opacity of the overlay window.
If alpha is -1
, use per-pixel alpha blending, otherwise use the given alpha value for all pixels.