A wxDC is a device context onto which graphics and text can be drawn.
The device context is intended to represent a number of output devices in a generic way, with the same API being used throughout.
Objects of wxDC class itself can't be created, instead you should create objects of the following classes:
To draw on a window, you need to create a wxPaintDC object in the paint event handler:
To obtain information about a device context associated with a window outside of its paint event handler, you need to use wxInfoDC, e.g. the window as argument, for example:
When writing drawing code, it is recommended to extract it into a function taking wxDC as an argument. This allows you to reuse the same code for drawing and printing, by calling it with either wxPaintDC or wxPrinterDC.
Please note that other device context classes that could previously be used for painting on screen cannot be used any more due to the architecture of the modern graphics systems. In particular, wxClientDC, wxWindowDC and wxScreenDC are not guaranteed to work any longer.