wxDC: wxObject

A wxDC is device context onto which graphics and text can be drawn. It is intended to represent a number of output devices in a generic way, so a canvas has a device context and a printer also has a device context. In this way, the same piece of code may write to a number of different devices, if the device context is used as a parameter.

To determine whether a device context is colour or monochrome, test the Colour Bool member variable. To override wxWindows monochrome graphics drawing behaviour, set this member to TRUE.

From version 1.5, this class is abstract and cannot be used to create device context objects. Instead, use the derived classes wxPostScriptDC, wxMetaFileDC, wxMemoryDC or wxPrinterDC (Windows only) for constructing new device contexts. wxCanvasDC is a context that cannot be created by the user but can be retrieved from a wxCanvas by using wxCanvas::GetDC.

When writing code to draw into a device context, use wxDC as a parameter whenever possible, to allow the most general use of your drawing code. You can then pass a device context object of any derived type. See the demo in samples/hello for code which uses this device-independent method of drawing.

Derived types of wxDC have documentation for specific features only, so refer to this section for most device context information.

wxDC::wxDC

wxDC::~wxDC

wxDC::Blit

wxDC::Clear

wxDC::DestroyClippingRegion

wxDC::DeviceToLogicalX

wxDC::DeviceToLogicalY

wxDC::DrawEllipse

wxDC::DrawIcon

wxDC::DrawLine

wxDC::DrawLines

wxDC::DrawPolygon

wxDC::DrawPoint

wxDC::DrawRectangle

wxDC::DrawRoundedRectangle

wxDC::DrawSpline

wxDC::DrawText

wxDC::EndDoc

wxDC::EndPage

wxDC::GetMapMode

wxDC::GetTextExtent

wxDC::LogicalToDeviceX

wxDC::LogicalToDeviceY

wxDC::MaxX

wxDC::MaxY

wxDC::MinX

wxDC::MinY

wxDC::Ok

wxDC::SetBackground

wxDC::SetBackgroundMode

wxDC::SetClippingRegion

wxDC::SetBrush

wxDC::SetFont

wxDC::SetLogicalFunction

wxDC::SetMapMode

wxDC::SetPen

wxDC::SetTextBackground

wxDC::SetTextForeground

wxDC::SetUserScale

wxDC::StartDoc

wxDC::StartPage