1wxRegion(3) Erlang Module Definition wxRegion(3)
2
3
4
6 wxRegion - Functions for wxRegion class
7
9 A wxRegion represents a simple or complex region on a device context or
10 window.
11
12 This class uses reference counting and copy-on-write internally so that
13 assignments between two instances of this class are very cheap. You can
14 therefore use actual objects instead of pointers without efficiency
15 problems. If an instance of this class is changed it will create its
16 own data internally so that other instances, which previously shared
17 the data using the reference counting, are not affected.
18
19 Predefined objects (include wx.hrl):
20
21 See: wxRegionIterator (not implemented in wx)
22
23 wxWidgets docs: wxRegion
24
26 wxRegion() = wx:wx_object()
27
29 new() -> wxRegion()
30
31 Default constructor.
32
33 This constructor creates an invalid, or null, object, i.e. call‐
34 ing IsOk() on it returns false and isEmpty/1 returns true.
35
36 new(Rect) -> wxRegion()
37
38 new(Bmp) -> wxRegion()
39
40 Types:
41
42 Bmp = wxBitmap:wxBitmap()
43
44 Constructs a region using a bitmap.
45
46 See union/5 for more details.
47
48 new(TopLeft, BottomRight) -> wxRegion()
49
50 Types:
51
52 TopLeft = BottomRight = {X :: integer(), Y :: integer()}
53
54 Constructs a rectangular region from the top left point and the
55 bottom right point.
56
57 new(X, Y, Width, Height) -> wxRegion()
58
59 Types:
60
61 X = Y = Width = Height = integer()
62
63 Constructs a rectangular region with the given position and
64 size.
65
66 destroy(This :: wxRegion()) -> ok
67
68 Destructor.
69
70 See reference-counted object destruction for more info.
71
72 clear(This) -> ok
73
74 Types:
75
76 This = wxRegion()
77
78 Clears the current region.
79
80 The object becomes invalid, or null, after being cleared.
81
82 contains(This, Pt) -> wx:wx_enum()
83
84 contains(This, Rect) -> wx:wx_enum()
85
86 Types:
87
88 This = wxRegion()
89 Rect =
90 {X :: integer(),
91 Y :: integer(),
92 W :: integer(),
93 H :: integer()}
94
95 Returns a value indicating whether the given rectangle is con‐
96 tained within the region.
97
98 This method always returns wxOutRegion for an invalid region but
99 may, nevertheless, be safely called in this case.
100
101 Return: One of ?wxOutRegion, ?wxPartRegion or ?wxInRegion.
102
103 Note: On Windows, only ?wxOutRegion and ?wxInRegion are re‐
104 turned; a value ?wxInRegion then indicates that all or some part
105 of the region is contained in this region.
106
107 contains(This, X, Y) -> wx:wx_enum()
108
109 Types:
110
111 This = wxRegion()
112 X = Y = integer()
113
114 Returns a value indicating whether the given point is contained
115 within the region.
116
117 This method always returns wxOutRegion for an invalid region but
118 may, nevertheless, be safely called in this case.
119
120 Return: The return value is one of wxOutRegion and wxInRegion.
121
122 contains(This, X, Y, Width, Height) -> wx:wx_enum()
123
124 Types:
125
126 This = wxRegion()
127 X = Y = Width = Height = integer()
128
129 Returns a value indicating whether the given rectangle is con‐
130 tained within the region.
131
132 This method always returns wxOutRegion for an invalid region but
133 may, nevertheless, be safely called in this case.
134
135 Return: One of ?wxOutRegion, ?wxPartRegion or ?wxInRegion.
136
137 Note: On Windows, only ?wxOutRegion and ?wxInRegion are re‐
138 turned; a value ?wxInRegion then indicates that all or some part
139 of the region is contained in this region.
140
141 convertToBitmap(This) -> wxBitmap:wxBitmap()
142
143 Types:
144
145 This = wxRegion()
146
147 Convert the region to a black and white bitmap with the white
148 pixels being inside the region.
149
150 This method can't be used for invalid region.
151
152 getBox(This) ->
153 {X :: integer(),
154 Y :: integer(),
155 W :: integer(),
156 H :: integer()}
157
158 Types:
159
160 This = wxRegion()
161
162 intersect(This, Rect) -> boolean()
163
164 intersect(This, Region) -> boolean()
165
166 Types:
167
168 This = Region = wxRegion()
169
170 Finds the intersection of this region and another region.
171
172 This method always fails, i.e. returns false, if this region is
173 invalid but may nevertheless be safely used even in this case.
174
175 Return: true if successful, false otherwise.
176
177 Remark: Creates the intersection of the two regions, that is,
178 the parts which are in both regions. The result is stored in
179 this region.
180
181 intersect(This, X, Y, Width, Height) -> boolean()
182
183 Types:
184
185 This = wxRegion()
186 X = Y = Width = Height = integer()
187
188 Finds the intersection of this region and another, rectangular
189 region, specified using position and size.
190
191 This method always fails, i.e. returns false, if this region is
192 invalid but may nevertheless be safely used even in this case.
193
194 Return: true if successful, false otherwise.
195
196 Remark: Creates the intersection of the two regions, that is,
197 the parts which are in both regions. The result is stored in
198 this region.
199
200 isEmpty(This) -> boolean()
201
202 Types:
203
204 This = wxRegion()
205
206 Returns true if the region is empty, false otherwise.
207
208 Always returns true if the region is invalid.
209
210 subtract(This, Rect) -> boolean()
211
212 subtract(This, Region) -> boolean()
213
214 Types:
215
216 This = Region = wxRegion()
217
218 Subtracts a region from this region.
219
220 This method always fails, i.e. returns false, if this region is
221 invalid but may nevertheless be safely used even in this case.
222
223 Return: true if successful, false otherwise.
224
225 Remark: This operation combines the parts of 'this' region that
226 are not part of the second region. The result is stored in this
227 region.
228
229 offset(This, Pt) -> boolean()
230
231 Types:
232
233 This = wxRegion()
234 Pt = {X :: integer(), Y :: integer()}
235
236 offset(This, X, Y) -> boolean()
237
238 Types:
239
240 This = wxRegion()
241 X = Y = integer()
242
243 Moves the region by the specified offsets in horizontal and ver‐
244 tical directions.
245
246 This method can't be called if the region is invalid as it
247 doesn't make sense to offset it then. Attempts to do it will re‐
248 sult in assert failure.
249
250 Return: true if successful, false otherwise (the region is un‐
251 changed then).
252
253 union(This, Region) -> boolean()
254
255 union(This, Rect) -> boolean()
256
257 Types:
258
259 This = wxRegion()
260 Rect =
261 {X :: integer(),
262 Y :: integer(),
263 W :: integer(),
264 H :: integer()}
265
266 Finds the union of this region and another, rectangular region.
267
268 This method can be used even if this region is invalid and has
269 the natural behaviour in this case, i.e. makes this region equal
270 to the given rectangle.
271
272 Return: true if successful, false otherwise.
273
274 Remark: This operation creates a region that combines all of
275 this region and the second region. The result is stored in this
276 region.
277
278 union(This, Bmp, TransColour) -> boolean()
279
280 Types:
281
282 This = wxRegion()
283 Bmp = wxBitmap:wxBitmap()
284 TransColour = wx:wx_colour()
285
286 union(This, Bmp, TransColour, Options :: [Option]) -> boolean()
287
288 Types:
289
290 This = wxRegion()
291 Bmp = wxBitmap:wxBitmap()
292 TransColour = wx:wx_colour()
293 Option = {tolerance, integer()}
294
295 Finds the union of this region and the non-transparent pixels of
296 a bitmap.
297
298 Colour to be treated as transparent is specified in the trans‐
299 Colour argument, along with an optional colour tolerance value.
300
301 Return: true if successful, false otherwise.
302
303 Remark: This operation creates a region that combines all of
304 this region and the second region. The result is stored in this
305 region.
306
307 union(This, X, Y, Width, Height) -> boolean()
308
309 Types:
310
311 This = wxRegion()
312 X = Y = Width = Height = integer()
313
314 Finds the union of this region and another, rectangular region,
315 specified using position and size.
316
317 This method can be used even if this region is invalid and has
318 the natural behaviour in this case, i.e. makes this region equal
319 to the given rectangle.
320
321 Return: true if successful, false otherwise.
322
323 Remark: This operation creates a region that combines all of
324 this region and the second region. The result is stored in this
325 region.
326
327 'Xor'(This, Rect) -> boolean()
328
329 'Xor'(This, Region) -> boolean()
330
331 Types:
332
333 This = Region = wxRegion()
334
335 Finds the Xor of this region and another region.
336
337 This method can be used even if this region is invalid and has
338 the natural behaviour in this case, i.e. makes this region equal
339 to the given region.
340
341 Return: true if successful, false otherwise.
342
343 Remark: This operation creates a region that combines all of
344 this region and the second region, except for any overlapping
345 areas. The result is stored in this region.
346
347 'Xor'(This, X, Y, Width, Height) -> boolean()
348
349 Types:
350
351 This = wxRegion()
352 X = Y = Width = Height = integer()
353
354 Finds the Xor of this region and another, rectangular region,
355 specified using position and size.
356
357 This method can be used even if this region is invalid and has
358 the natural behaviour in this case, i.e. makes this region equal
359 to the given rectangle.
360
361 Return: true if successful, false otherwise.
362
363 Remark: This operation creates a region that combines all of
364 this region and the second region, except for any overlapping
365 areas. The result is stored in this region.
366
367
368
369wxWidgets team. wx 2.2.1 wxRegion(3)