]> git.saurik.com Git - wxWidgets.git/blob - docs/doxygen/overviews/dc.h
use @subpage where possible instead of @ref
[wxWidgets.git] / docs / doxygen / overviews / dc.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dc
3 // Purpose: topic overview
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /*!
10
11 @page dc_overview Device context overview
12
13 Classes: #wxBufferedDC, #wxBufferedPaintDC, #wxDC, #wxPostScriptDC,
14 #wxMetafileDC, #wxMemoryDC, #wxPrinterDC,
15 #wxScreenDC, #wxClientDC, #wxPaintDC,
16 #wxWindowDC.
17 A wxDC is a @e device context onto which graphics and text can be drawn.
18 The device context is intended to represent a number of output devices in a generic way,
19 with the same API being used throughout.
20 Some device contexts are created temporarily in order to draw on a window.
21 This is @true of #wxScreenDC, #wxClientDC, #wxPaintDC,
22 and #wxWindowDC. The following describes the differences between
23 these device contexts and when you should use them.
24
25
26 @b wxScreenDC. Use this to paint on the screen, as opposed to an individual window.
27 @b wxClientDC. Use this to paint on the client area of window (the part without
28 borders and other decorations), but do not use it from within an #wxPaintEvent.
29 @b wxPaintDC. Use this to paint on the client area of a window, but @e only from
30 within a #wxPaintEvent.
31 @b wxWindowDC. Use this to paint on the whole area of a window, including decorations.
32 This may not be available on non-Windows platforms.
33
34
35 To use a client, paint or window device context, create an object on the stack with
36 the window as argument, for example:
37
38 @code
39 void MyWindow::OnMyCmd(wxCommandEvent& event)
40 {
41 wxClientDC dc(window);
42 DrawMyPicture(dc);
43 }
44 @endcode
45
46 Try to write code so it is parameterised by wxDC - if you do this, the same piece of code may
47 write to a number of different devices, by passing a different device context. This doesn't
48 work for everything (for example not all device contexts support bitmap drawing) but
49 will work most of the time.
50
51 */
52
53