1 \section{\class{wxMemoryDC
}}\label{wxmemorydc
}
3 A memory device context provides a means to draw graphics onto a bitmap. When
4 drawing in to a mono-bitmap, using
{\tt wxWHITE
},
{\tt wxWHITE
\_PEN} and
6 will draw the background colour (i.e.
0) whereas all other colours will draw the
7 foreground colour (i.e.
1).
9 \wxheading{Derived from
}
11 \helpref{wxDC
}{wxdc
}\\
12 \helpref{wxObject
}{wxobject
}
14 \wxheading{Include files
}
20 A bitmap must be selected into the new memory DC before it may be used
21 for anything. Typical usage is as follows:
26 temp_dc.SelectObject(test_bitmap);
28 // We can now draw into the memory DC...
29 // Copy from this DC to another DC.
30 old_dc.Blit(
250,
50, BITMAP_WIDTH, BITMAP_HEIGHT, temp_dc,
0,
0);
33 Note that the memory DC
{\it must
} be deleted (or the bitmap selected out of it) before a bitmap
34 can be reselected into another memory DC.
38 \helpref{wxBitmap
}{wxbitmap
},
\helpref{wxDC
}{wxdc
}
40 \latexignore{\rtfignore{\wxheading{Members
}}}
42 \membersection{wxMemoryDC::wxMemoryDC
}\label{wxmemorydcctor
}
44 \func{}{wxMemoryDC
}{\param{const wxBitmap\&
}{bitmap = wxNullBitmap
}}
46 Constructs a new memory device context.
48 Use the
{\it Ok
} member to test whether the constructor was successful
49 in creating a usable device context. If you don't pass a valid bitmap
50 to the constructor, don't forget to select a bitmap into the DC before
53 \membersection{wxMemoryDC::SelectObject
}\label{wxmemorydcselectobject
}
55 \func{void
}{SelectObject
}{\param{const wxBitmap\&
}{bitmap
}}
57 Selects the given bitmap into the device context, to use as the memory
58 bitmap. Selecting the bitmap into a memory DC allows you to draw into
59 the DC (and therefore the bitmap) and also to use
{\bf Blit
} to copy
60 the bitmap to a window. For this purpose, you may find
\helpref{wxDC::DrawIcon
}{wxdcdrawicon
}\rtfsp
61 easier to use instead.
63 If the argument is wxNullBitmap (or some other uninitialised wxBitmap) the current bitmap is selected out of the device
64 context, and the original bitmap restored, allowing the current bitmap to