1wxMemoryDC(3) Erlang Module Definition wxMemoryDC(3)
2
3
4
6 wxMemoryDC - Functions for wxMemoryDC class
7
9 A memory device context provides a means to draw graphics onto a bit‐
10 map. When drawing in to a mono-bitmap, using wxWHITE, wxWHITE_PEN and
11 wxWHITE_BRUSH will draw the background colour (i.e. 0) whereas all
12 other colours will draw the foreground colour (i.e. 1).
13
14 A bitmap must be selected into the new memory DC before it may be used
15 for anything. Typical usage is as follows:
16
17 Note that the memory DC must be deleted (or the bitmap selected out of
18 it) before a bitmap can be reselected into another memory DC.
19
20 And, before performing any other operations on the bitmap data, the
21 bitmap must be selected out of the memory DC:
22
23 This happens automatically when wxMemoryDC object goes out of scope.
24
25 See: wxBitmap, wxDC
26
27 This class is derived (and can use functions) from: wxDC
28
29 wxWidgets docs: wxMemoryDC
30
32 wxMemoryDC() = wx:wx_object()
33
35 new() -> wxMemoryDC()
36
37 Constructs a new memory device context.
38
39 Use the wxDC:isOk/1 member to test whether the constructor was
40 successful in creating a usable device context. Don't forget to
41 select a bitmap into the DC before drawing on it.
42
43 new(Dc) -> wxMemoryDC()
44
45 Types:
46
47 Dc = wxDC:wxDC() | wxBitmap:wxBitmap()
48
49 Constructs a new memory device context having the same charac‐
50 teristics as the given existing device context.
51
52 This constructor creates a memory device context compatible with
53 dc in wxMSW, the argument is ignored in the other ports. If dc
54 is NULL, a device context compatible with the screen is created,
55 just as with the default constructor.
56
57 selectObject(This, Bitmap) -> ok
58
59 Types:
60
61 This = wxMemoryDC()
62 Bitmap = wxBitmap:wxBitmap()
63
64 Works exactly like selectObjectAsSource/2 but this is the func‐
65 tion you should use when you select a bitmap because you want to
66 modify it, e.g.
67
68 drawing on this DC.
69
70 Using selectObjectAsSource/2 when modifying the bitmap may incur
71 some problems related to wxBitmap being a reference counted ob‐
72 ject (see overview_refcount).
73
74 Before using the updated bitmap data, make sure to select it out
75 of context first either by selecting ?wxNullBitmap into the de‐
76 vice context or destroying the device context entirely.
77
78 If the bitmap is already selected in this device context, noth‐
79 ing is done. If it is selected in another context, the function
80 asserts and drawing on the bitmap won't work correctly.
81
82 See: wxDC:drawBitmap/4
83
84 selectObjectAsSource(This, Bitmap) -> ok
85
86 Types:
87
88 This = wxMemoryDC()
89 Bitmap = wxBitmap:wxBitmap()
90
91 Selects the given bitmap into the device context, to use as the
92 memory bitmap.
93
94 Selecting the bitmap into a memory DC allows you to draw into
95 the DC (and therefore the bitmap) and also to use wxDC:blit/6 to
96 copy the bitmap to a window. For this purpose, you may find
97 wxDC:drawIcon/3 easier to use instead.
98
99 If the argument is ?wxNullBitmap (or some other uninitialised
100 wxBitmap) the current bitmap is selected out of the device con‐
101 text, and the original bitmap restored, allowing the current
102 bitmap to be destroyed safely.
103
104 destroy(This :: wxMemoryDC()) -> ok
105
106 Destroys the object.
107
108
109
110wxWidgets team. wx 2.2.2 wxMemoryDC(3)