]>
Commit | Line | Data |
---|---|---|
164e084a CE |
1 | \section{\class{wxSVGFileDC}}\label{wxSVGFileDC} |
2 | ||
3 | A wxSVGFileDC is a {\it device context} onto which graphics and text can be drawn, and the output | |
4 | produced as a vector file, in the SVG format (see http://www.w3.org/TR/2001/REC-SVG-20010904/ ). | |
5 | This format can be read by a range of programs, including a Netscape plugin (Adobe), full details at | |
6 | http://www.w3.org/Graphics/SVG/SVG-Implementations.htm8 Vector formats may often be smaller | |
7 | than raster formats. | |
8 | ||
9 | The intention behind wxSVGFileDC is that it can be used to produce a file corresponding | |
10 | to the screen display context, wxSVGFileDC, by passing the wxSVGFileDC as a parameter instead of a wxSVGFileDC. Thus | |
11 | the wxSVGFileDC is a write-only class. | |
12 | ||
13 | As the wxSVGFileDC is a vector format, raster operations like GetPixel are unlikely to be supported. | |
14 | However, the SVG specification allows for PNG format raster files to be embedded in the SVG, and so | |
15 | bitmaps, icons and blit operations into the wxSVGFileDC are supported. | |
16 | ||
17 | A more substantial SVG library (for reading and writing) is available at | |
18 | http://www.xs4all.nl/~kholwerd/wxstuff/canvas/htmldocbook/aap.html | |
19 | ||
20 | \wxheading{Derived from} | |
21 | ||
22 | \helpref{wxDCBase}{wxDCBase} | |
23 | ||
24 | \wxheading{Include files} | |
25 | ||
26 | <wx/dcsvg.h> | |
27 | ||
28 | \wxheading{See also} | |
29 | ||
30 | %\helpref{Overview}{dcoverview} | |
31 | ||
32 | ||
33 | \latexignore{\rtfignore{\wxheading{Members}}} | |
34 | ||
35 | \membersection{wxSVGFileDC::wxSVGFileDC} | |
36 | ||
37 | \func{}{wxSVGFileDC}{\param{wxString}{ f}} \rtfsp | |
38 | \func{}{wxSVGFileDC}{\param{wxString}{ f}, \param{int}{ Width},\param{int}{ Height}} \rtfsp | |
39 | \func{}{wxSVGFileDC}{\param{wxString}{ f}, \param{int}{ Width},\param{int}{ Height},\param{float}{ dpi}} \rtfsp | |
40 | ||
41 | Constructors: | |
42 | a filename {\it f} with default size 340x240 at 72.0 dots per inch (a frequent screen resolution). | |
43 | a filename {\it f} with size {\it Width} by {\it Height} at 72.0 dots per inch | |
44 | a filename {\it f} with size {\it Width} by {\it Height} at {\it dpi} resolution. | |
45 | ||
46 | \membersection{wxSVGFileDC::\destruct{wxSVGFileDC}} | |
47 | ||
48 | \func{}{\destruct{wxSVGFileDC}}{\void} | |
49 | ||
50 | Destructor. | |
51 | ||
52 | \membersection{wxSVGFileDC::BeginDrawing}\label{wxdcbegindrawing} | |
53 | ||
54 | Does nothing | |
55 | ||
56 | \membersection{wxSVGFileDC::Blit}\label{wxdcblit} | |
57 | ||
58 | \func{bool}{Blit}{\param{wxCoord}{ xdest}, \param{wxCoord}{ ydest}, \param{wxCoord}{ width}, \param{wxCoord}{ height}, | |
59 | \param{wxSVGFileDC* }{source}, \param{wxCoord}{ xsrc}, \param{wxCoord}{ ysrc}, \param{int}{ logicalFunc = wxCOPY}, | |
60 | \param{bool }{useMask = FALSE}, \param{wxCoord}{ xsrcMask = -1}, \param{wxCoord}{ ysrcMask = -1}} | |
61 | ||
62 | As wxDC: Copy from a source DC to this DC, specifying the destination | |
63 | coordinates, size of area to copy, source DC, source coordinates, | |
64 | logical function, whether to use a bitmap mask, and mask source position. | |
65 | ||
66 | \membersection{wxSVGFileDC::CalcBoundingBox}\label{wxdccalcboundingbox} | |
67 | ||
68 | \func{void}{CalcBoundingBox}{\param{wxCoord }{x}, \param{wxCoord }{y}} | |
69 | ||
70 | Adds the specified point to the bounding box which can be retrieved with | |
71 | \helpref{MinX}{wxdcminx}, \helpref{MaxX}{wxdcmaxx} and | |
72 | \helpref{MinY}{wxdcminy}, \helpref{MaxY}{wxdcmaxy} functions. | |
73 | ||
74 | ||
75 | \membersection{wxSVGFileDC::Clear}\label{wxdcclear} | |
76 | ||
77 | \func{void}{Clear}{\void} | |
78 | ||
79 | This makes no sense in wxSVGFileDC and does nothing | |
80 | ||
81 | ||
82 | \membersection{wxSVGFileDC::CrossHair}\label{wxdccrosshair} | |
83 | ||
84 | \func{void}{CrossHair}{\param{wxCoord}{ x}, \param{wxCoord}{ y}} | |
85 | ||
86 | Not Implemented | |
87 | ||
88 | \membersection{wxSVGFileDC::DestroyClippingRegion}\label{wxdcdestroyclippingregion} | |
89 | ||
90 | \func{void}{DestroyClippingRegion}{\void} | |
91 | ||
92 | Not Implemented | |
93 | ||
94 | \membersection{wxSVGFileDC::DeviceToLogicalX}\label{wxdcdevicetologicalx} | |
95 | ||
96 | \func{wxCoord}{DeviceToLogicalX}{\param{wxCoord}{ x}} | |
97 | ||
98 | Convert device X coordinate to logical coordinate, using the current | |
99 | mapping mode. | |
100 | ||
101 | \membersection{wxSVGFileDC::DeviceToLogicalXRel}\label{wxdcdevicetologicalxrel} | |
102 | ||
103 | \func{wxCoord}{DeviceToLogicalXRel}{\param{wxCoord}{ x}} | |
104 | ||
105 | Convert device X coordinate to relative logical coordinate, using the current | |
106 | mapping mode but ignoring the x axis orientation. | |
107 | Use this function for converting a width, for example. | |
108 | ||
109 | \membersection{wxSVGFileDC::DeviceToLogicalY}\label{wxdcdevicetologicaly} | |
110 | ||
111 | \func{wxCoord}{DeviceToLogicalY}{\param{wxCoord}{ y}} | |
112 | ||
113 | Converts device Y coordinate to logical coordinate, using the current | |
114 | mapping mode. | |
115 | ||
116 | \membersection{wxSVGFileDC::DeviceToLogicalYRel}\label{wxdcdevicetologicalyrel} | |
117 | ||
118 | \func{wxCoord}{DeviceToLogicalYRel}{\param{wxCoord}{ y}} | |
119 | ||
120 | Convert device Y coordinate to relative logical coordinate, using the current | |
121 | mapping mode but ignoring the y axis orientation. | |
122 | Use this function for converting a height, for example. | |
123 | ||
124 | \membersection{wxSVGFileDC::DrawArc}\label{wxdcdrawarc} | |
125 | ||
126 | \func{void}{DrawArc}{\param{wxCoord}{ x1}, \param{wxCoord}{ y1}, \param{wxCoord}{ x2}, \param{wxCoord}{ y2}, \param{double}{ xc}, \param{double}{ yc}} | |
127 | ||
128 | Draws an arc of a circle, centred on ({\it xc, yc}), with starting point ({\it x1, y1}) | |
129 | and ending at ({\it x2, y2}). The current pen is used for the outline | |
130 | and the current brush for filling the shape. | |
131 | ||
132 | The arc is drawn in an anticlockwise direction from the start point to the end point. | |
133 | ||
134 | \membersection{wxSVGFileDC::DrawBitmap}\label{wxdcdrawbitmap} | |
135 | ||
136 | \func{void}{DrawBitmap}{\param{const wxBitmap\&}{ bitmap}, \param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{bool}{ transparent}} | |
137 | ||
138 | Draw a bitmap on the device context at the specified point. If {\it transparent} is TRUE and the bitmap has | |
139 | a transparency mask, the bitmap will be drawn transparently. | |
140 | ||
141 | When drawing a mono-bitmap, the current text foreground colour will be used to draw the foreground | |
142 | of the bitmap (all bits set to 1), and the current text background colour to draw the background | |
143 | (all bits set to 0). See also \helpref{SetTextForeground}{wxdcsettextforeground}, | |
144 | \helpref{SetTextBackground}{wxdcsettextbackground} and \helpref{wxMemoryDC}{wxmemorydc}. | |
145 | ||
146 | \membersection{wxSVGFileDC::DrawCheckMark}\label{wxdcdrawcheckmark} | |
147 | ||
148 | \func{void}{DrawCheckMark}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}} | |
149 | ||
150 | \func{void}{DrawCheckMark}{\param{const wxRect \&}{rect}} | |
151 | ||
152 | Draws a check mark inside the given rectangle. | |
153 | ||
154 | \membersection{wxSVGFileDC::DrawCircle}\label{wxdcdrawcircle} | |
155 | ||
156 | \func{void}{DrawCircle}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ radius}} | |
157 | ||
158 | \func{void}{DrawCircle}{\param{const wxPoint\&}{ pt}, \param{wxCoord}{ radius}} | |
159 | ||
160 | Draws a circle with the given centre and radius. | |
161 | ||
162 | \wxheading{See also} | |
163 | ||
164 | \helpref{DrawEllipse}{wxdcdrawellipse} | |
165 | ||
166 | \membersection{wxSVGFileDC::DrawEllipse}\label{wxdcdrawellipse} | |
167 | ||
168 | \func{void}{DrawEllipse}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}} | |
169 | ||
170 | \func{void}{DrawEllipse}{\param{const wxPoint\&}{ pt}, \param{const wxSize\&}{ size}} | |
171 | ||
172 | \func{void}{DrawEllipse}{\param{const wxRect\&}{ rect}} | |
173 | ||
174 | Draws an ellipse contained in the rectangle specified either with the given top | |
175 | left corner and the given size or directly. The current pen is used for the | |
176 | outline and the current brush for filling the shape. | |
177 | ||
178 | \wxheading{See also} | |
179 | ||
180 | \helpref{DrawCircle}{wxdcdrawcircle} | |
181 | ||
182 | \membersection{wxSVGFileDC::DrawEllipticArc}\label{wxdcdrawellipticarc} | |
183 | ||
184 | \func{void}{DrawEllipticArc}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}, | |
185 | \param{double}{ start}, \param{double}{ end}} | |
186 | ||
187 | Draws an arc of an ellipse. The current pen is used for drawing the arc and | |
188 | the current brush is used for drawing the pie. | |
189 | ||
190 | {\it x} and {\it y} specify the x and y coordinates of the upper-left corner of the rectangle that contains | |
191 | the ellipse. | |
192 | ||
193 | {\it width} and {\it height} specify the width and height of the rectangle that contains | |
194 | the ellipse. | |
195 | ||
196 | {\it start} and {\it end} specify the start and end of the arc relative to the three-o'clock | |
197 | position from the center of the rectangle. Angles are specified | |
198 | in degrees (360 is a complete circle). Positive values mean | |
199 | counter-clockwise motion. If {\it start} is equal to {\it end}, a | |
200 | complete ellipse will be drawn. | |
201 | ||
202 | \membersection{wxSVGFileDC::DrawIcon}\label{wxdcdrawicon} | |
203 | ||
204 | \func{void}{DrawIcon}{\param{const wxIcon\&}{ icon}, \param{wxCoord}{ x}, \param{wxCoord}{ y}} | |
205 | ||
206 | Draw an icon on the display (does nothing if the device context is PostScript). | |
207 | This can be the simplest way of drawing bitmaps on a window. | |
208 | ||
209 | \membersection{wxSVGFileDC::DrawLine}\label{wxdcdrawline} | |
210 | ||
211 | \func{void}{DrawLine}{\param{wxCoord}{ x1}, \param{wxCoord}{ y1}, \param{wxCoord}{ x2}, \param{wxCoord}{ y2}} | |
212 | ||
213 | Draws a line from the first point to the second. The current pen is used | |
214 | for drawing the line. | |
215 | ||
216 | \membersection{wxSVGFileDC::DrawLines}\label{wxdcdrawlines} | |
217 | ||
218 | \func{void}{DrawLines}{\param{int}{ n}, \param{wxPoint}{ points[]}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0}} | |
219 | ||
220 | \func{void}{DrawLines}{\param{wxList *}{points}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0}} | |
221 | ||
222 | Draws lines using an array of {\it points} of size {\it n}, or list of | |
223 | pointers to points, adding the optional offset coordinate. The current | |
224 | pen is used for drawing the lines. The programmer is responsible for | |
225 | deleting the list of points. | |
226 | ||
227 | \membersection{wxSVGFileDC::DrawPolygon}\label{wxdcdrawpolygon} | |
228 | ||
229 | \func{void}{DrawPolygon}{\param{int}{ n}, \param{wxPoint}{ points[]}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0},\\ | |
230 | \param{int }{fill\_style = wxODDEVEN\_RULE}} | |
231 | ||
232 | \func{void}{DrawPolygon}{\param{wxList *}{points}, \param{wxCoord}{ xoffset = 0}, \param{wxCoord}{ yoffset = 0},\\ | |
233 | \param{int }{fill\_style = wxODDEVEN\_RULE}} | |
234 | ||
235 | Draws a filled polygon using an array of {\it points} of size {\it n}, | |
236 | or list of pointers to points, adding the optional offset coordinate. | |
237 | ||
238 | The last argument specifies the fill rule: {\bf wxODDEVEN\_RULE} (the | |
239 | default) or {\bf wxWINDING\_RULE}. | |
240 | ||
241 | The current pen is used for drawing the outline, and the current brush | |
242 | for filling the shape. Using a transparent brush suppresses filling. | |
243 | The programmer is responsible for deleting the list of points. | |
244 | ||
245 | Note that wxWindows automatically closes the first and last points. | |
246 | ||
247 | ||
248 | \membersection{wxSVGFileDC::DrawPoint}\label{wxdcdrawpoint} | |
249 | ||
250 | \func{void}{DrawPoint}{\param{wxCoord}{ x}, \param{wxCoord}{ y}} | |
251 | ||
252 | Draws a point using the current pen. | |
253 | ||
254 | \membersection{wxSVGFileDC::DrawRectangle}\label{wxdcdrawrectangle} | |
255 | ||
256 | \func{void}{DrawRectangle}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}} | |
257 | ||
258 | Draws a rectangle with the given top left corner, and with the given | |
259 | size. The current pen is used for the outline and the current brush | |
260 | for filling the shape. | |
261 | ||
262 | \membersection{wxSVGFileDC::DrawRotatedText}\label{wxdcdrawrotatedtext} | |
263 | ||
264 | \func{void}{DrawRotatedText}{\param{const wxString\& }{text}, \param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{double}{ angle}} | |
265 | ||
266 | Draws the text rotated by {\it angle} degrees. | |
267 | ||
268 | The wxMSW wxDC and wxSVGFileDC rotate the text around slightly different points, depending on the size of the font | |
269 | ||
270 | \membersection{wxSVGFileDC::DrawRoundedRectangle}\label{wxdcdrawroundedrectangle} | |
271 | ||
272 | \func{void}{DrawRoundedRectangle}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}, \param{double}{ radius = 20}} | |
273 | ||
274 | Draws a rectangle with the given top left corner, and with the given | |
275 | size. The corners are quarter-circles using the given radius. The | |
276 | current pen is used for the outline and the current brush for filling | |
277 | the shape. | |
278 | ||
279 | If {\it radius} is positive, the value is assumed to be the | |
280 | radius of the rounded corner. If {\it radius} is negative, | |
281 | the absolute value is assumed to be the {\it proportion} of the smallest | |
282 | dimension of the rectangle. This means that the corner can be | |
283 | a sensible size relative to the size of the rectangle, and also avoids | |
284 | the strange effects X produces when the corners are too big for | |
285 | the rectangle. | |
286 | ||
287 | \membersection{wxSVGFileDC::DrawSpline}\label{wxdcdrawspline} | |
288 | ||
289 | \func{void}{DrawSpline}{\param{wxList *}{points}} | |
290 | ||
291 | Draws a spline between all given control points, using the current | |
292 | pen. Doesn't delete the wxList and contents. The spline is drawn | |
293 | using a series of lines, using an algorithm taken from the X drawing | |
294 | program `XFIG'. | |
295 | ||
296 | \func{void}{DrawSpline}{\param{wxCoord}{ x1}, \param{wxCoord}{ y1}, \param{wxCoord}{ x2}, \param{wxCoord}{ y2}, \param{wxCoord}{ x3}, \param{wxCoord}{ y3}} | |
297 | ||
298 | Draws a three-point spline using the current pen. | |
299 | ||
300 | \membersection{wxSVGFileDC::DrawText}\label{wxdcdrawtext} | |
301 | ||
302 | \func{void}{DrawText}{\param{const wxString\& }{text}, \param{wxCoord}{ x}, \param{wxCoord}{ y}} | |
303 | ||
304 | Draws a text string at the specified point, using the current text font, | |
305 | and the current text foreground and background colours. | |
306 | ||
307 | The coordinates refer to the top-left corner of the rectangle bounding | |
308 | the string. See \helpref{wxSVGFileDC::GetTextExtent}{wxdcgettextextent} for how | |
309 | to get the dimensions of a text string, which can be used to position the | |
310 | text more precisely. | |
311 | ||
312 | ||
313 | ||
314 | \membersection{wxSVGFileDC::EndDoc}\label{wxdcenddoc} | |
315 | ||
316 | \func{void}{EndDoc}{\void} | |
317 | ||
318 | Does nothing | |
319 | ||
320 | \membersection{wxSVGFileDC::EndDrawing}\label{wxdcenddrawing} | |
321 | ||
322 | \func{void}{EndDrawing}{\void} | |
323 | ||
324 | Does nothing | |
325 | ||
326 | \membersection{wxSVGFileDC::EndPage}\label{wxdcendpage} | |
327 | ||
328 | \func{void}{EndPage}{\void} | |
329 | ||
330 | Does nothing | |
331 | ||
332 | \membersection{wxSVGFileDC::FloodFill}\label{wxdcfloodfill} | |
333 | ||
334 | \func{void}{FloodFill}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{const wxColour\&}{ colour}, \param{int}{ style=wxFLOOD\_SURFACE}} | |
335 | ||
336 | Not implemented | |
337 | ||
338 | \membersection{wxSVGFileDC::GetBackground}\label{wxdcgetbackground} | |
339 | ||
340 | \func{wxBrush\&}{GetBackground}{\void} | |
341 | ||
342 | \constfunc{const wxBrush\&}{GetBackground}{\void} | |
343 | ||
344 | Gets the brush used for painting the background (see \helpref{wxSVGFileDC::SetBackground}{wxdcsetbackground}). | |
345 | ||
346 | \membersection{wxSVGFileDC::GetBackgroundMode}\label{wxdcgetbackgroundmode} | |
347 | ||
348 | \constfunc{int}{GetBackgroundMode}{\void} | |
349 | ||
350 | Returns the current background mode: {\tt wxSOLID} or {\tt wxTRANSPARENT}. | |
351 | ||
352 | \wxheading{See also} | |
353 | ||
354 | \helpref{SetBackgroundMode}{wxdcsetbackgroundmode} | |
355 | ||
356 | \membersection{wxSVGFileDC::GetBrush}\label{wxdcgetbrush} | |
357 | ||
358 | \func{wxBrush\&}{GetBrush}{\void} | |
359 | ||
360 | \constfunc{const wxBrush\&}{GetBrush}{\void} | |
361 | ||
362 | Gets the current brush (see \helpref{wxSVGFileDC::SetBrush}{wxdcsetbrush}). | |
363 | ||
364 | \membersection{wxSVGFileDC::GetCharHeight}\label{wxdcgetcharheight} | |
365 | ||
366 | \func{wxCoord}{GetCharHeight}{\void} | |
367 | ||
368 | Gets the character height of the currently set font. | |
369 | ||
370 | \membersection{wxSVGFileDC::GetCharWidth}\label{wxdcgetcharwidth} | |
371 | ||
372 | \func{wxCoord}{GetCharWidth}{\void} | |
373 | ||
374 | Gets the average character width of the currently set font. | |
375 | ||
376 | \membersection{wxSVGFileDC::GetClippingBox}\label{wxdcgetclippingbox} | |
377 | ||
378 | \func{void}{GetClippingBox}{\param{wxCoord}{ *x}, \param{wxCoord}{ *y}, \param{wxCoord}{ *width}, \param{wxCoord}{ *height}} | |
379 | ||
380 | Not implemented | |
381 | ||
382 | \membersection{wxSVGFileDC::GetFont}\label{wxdcgetfont} | |
383 | ||
384 | \func{wxFont\&}{GetFont}{\void} | |
385 | ||
386 | \constfunc{const wxFont\&}{GetFont}{\void} | |
387 | ||
388 | Gets the current font (see \helpref{wxSVGFileDC::SetFont}{wxdcsetfont}). | |
389 | ||
390 | \membersection{wxSVGFileDC::GetLogicalFunction}\label{wxdcgetlogicalfunction} | |
391 | ||
392 | \func{int}{GetLogicalFunction}{\void} | |
393 | ||
394 | Gets the current logical function (see \helpref{wxSVGFileDC::SetLogicalFunction}{wxdcsetlogicalfunction}). | |
395 | ||
396 | \membersection{wxSVGFileDC::GetMapMode}\label{wxdcgetmapmode} | |
397 | ||
398 | \func{int}{GetMapMode}{\void} | |
399 | ||
400 | Gets the {\it mapping mode} for the device context (see \helpref{wxSVGFileDC::SetMapMode}{wxdcsetmapmode}). | |
401 | ||
402 | \membersection{wxSVGFileDC::GetOptimization}\label{wxdcgetoptimization} | |
403 | ||
404 | \func{bool}{GetOptimization}{\void} | |
405 | ||
406 | Always returns TRUE, with an assertion in debug mode that optimisation is not implemented | |
407 | ||
408 | \membersection{wxSVGFileDC::GetPen}\label{wxdcgetpen} | |
409 | ||
410 | \func{wxPen\&}{GetPen}{\void} | |
411 | ||
412 | \constfunc{const wxPen\&}{GetPen}{\void} | |
413 | ||
414 | Gets the current pen (see \helpref{wxSVGFileDC::SetPen}{wxdcsetpen}). | |
415 | ||
416 | \membersection{wxSVGFileDC::GetPixel}\label{wxdcgetpixel} | |
417 | ||
418 | \func{bool}{GetPixel}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxColour *}{colour}} | |
419 | ||
420 | Not implemented | |
421 | ||
422 | \membersection{wxSVGFileDC::GetSize}\label{wxdcgetsize} | |
423 | ||
424 | \func{void}{GetSize}{\param{wxCoord *}{width}, \param{wxCoord *}{height}} | |
425 | ||
426 | ||
427 | For a Windows printer device context, this gets the horizontal and vertical | |
428 | resolution. | |
429 | ||
430 | \membersection{wxSVGFileDC::GetTextBackground}\label{wxdcgettextbackground} | |
431 | ||
432 | \func{wxColour\&}{GetTextBackground}{\void} | |
433 | ||
434 | \constfunc{const wxColour\&}{GetTextBackground}{\void} | |
435 | ||
436 | Gets the current text background colour (see \helpref{wxSVGFileDC::SetTextBackground}{wxdcsettextbackground}). | |
437 | ||
438 | \membersection{wxSVGFileDC::GetTextExtent}\label{wxdcgettextextent} | |
439 | ||
440 | \func{void}{GetTextExtent}{\param{const wxString\& }{string}, \param{wxCoord *}{w}, \param{wxCoord *}{h},\\ | |
441 | \param{wxCoord *}{descent = NULL}, \param{wxCoord *}{externalLeading = NULL}, \param{wxFont *}{font = NULL}} | |
442 | ||
443 | Gets the dimensions of the string using the currently selected font. | |
444 | \rtfsp{\it string} is the text string to measure, {\it w} and {\it h} are | |
445 | the total width and height respectively, {\it descent} is the | |
446 | dimension from the baseline of the font to the bottom of the | |
447 | descender, and {\it externalLeading} is any extra vertical space added | |
448 | to the font by the font designer (usually is zero). | |
449 | ||
450 | The optional parameter {\it font} specifies an alternative | |
451 | to the currently selected font: but note that this does not | |
452 | yet work under Windows, so you need to set a font for | |
453 | the device context first. | |
454 | ||
455 | See also \helpref{wxFont}{wxfont}, \helpref{wxSVGFileDC::SetFont}{wxdcsetfont}. | |
456 | ||
457 | \membersection{wxSVGFileDC::GetTextForeground}\label{wxdcgettextforeground} | |
458 | ||
459 | \func{wxColour\&}{GetTextForeground}{\void} | |
460 | ||
461 | \constfunc{const wxColour\&}{GetTextForeground}{\void} | |
462 | ||
463 | Gets the current text foreground colour (see \helpref{wxSVGFileDC::SetTextForeground}{wxdcsettextforeground}). | |
464 | ||
465 | ||
466 | \membersection{wxSVGFileDC::GetUserScale}\label{wxdcgetuserscale} | |
467 | ||
468 | \func{void}{GetUserScale}{\param{double}{ *x}, \param{double}{ *y}} | |
469 | ||
470 | Gets the current user scale factor (set by \helpref{SetUserScale}{wxdcsetuserscale}). | |
471 | ||
472 | \membersection{wxSVGFileDC::LogicalToDeviceX}\label{wxdclogicaltodevicex} | |
473 | ||
474 | \func{wxCoord}{LogicalToDeviceX}{\param{wxCoord}{ x}} | |
475 | ||
476 | Converts logical X coordinate to device coordinate, using the current | |
477 | mapping mode. | |
478 | ||
479 | \membersection{wxSVGFileDC::LogicalToDeviceXRel}\label{wxdclogicaltodevicexrel} | |
480 | ||
481 | \func{wxCoord}{LogicalToDeviceXRel}{\param{wxCoord}{ x}} | |
482 | ||
483 | Converts logical X coordinate to relative device coordinate, using the current | |
484 | mapping mode but ignoring the x axis orientation. | |
485 | Use this for converting a width, for example. | |
486 | ||
487 | \membersection{wxSVGFileDC::LogicalToDeviceY}\label{wxdclogicaltodevicey} | |
488 | ||
489 | \func{wxCoord}{LogicalToDeviceY}{\param{wxCoord}{ y}} | |
490 | ||
491 | Converts logical Y coordinate to device coordinate, using the current | |
492 | mapping mode. | |
493 | ||
494 | \membersection{wxSVGFileDC::LogicalToDeviceYRel}\label{wxdclogicaltodeviceyrel} | |
495 | ||
496 | \func{wxCoord}{LogicalToDeviceYRel}{\param{wxCoord}{ y}} | |
497 | ||
498 | Converts logical Y coordinate to relative device coordinate, using the current | |
499 | mapping mode but ignoring the y axis orientation. | |
500 | Use this for converting a height, for example. | |
501 | ||
502 | \membersection{wxSVGFileDC::MaxX}\label{wxdcmaxx} | |
503 | ||
504 | \func{wxCoord}{MaxX}{\void} | |
505 | ||
506 | Gets the maximum horizontal extent used in drawing commands so far. | |
507 | ||
508 | \membersection{wxSVGFileDC::MaxY}\label{wxdcmaxy} | |
509 | ||
510 | \func{wxCoord}{MaxY}{\void} | |
511 | ||
512 | Gets the maximum vertical extent used in drawing commands so far. | |
513 | ||
514 | \membersection{wxSVGFileDC::MinX}\label{wxdcminx} | |
515 | ||
516 | \func{wxCoord}{MinX}{\void} | |
517 | ||
518 | Gets the minimum horizontal extent used in drawing commands so far. | |
519 | ||
520 | \membersection{wxSVGFileDC::MinY}\label{wxdcminy} | |
521 | ||
522 | \func{wxCoord}{MinY}{\void} | |
523 | ||
524 | Gets the minimum vertical extent used in drawing commands so far. | |
525 | ||
526 | \membersection{wxSVGFileDC::Ok}\label{wxdcok} | |
527 | ||
528 | \func{bool}{Ok}{\void} | |
529 | ||
530 | Returns TRUE if the DC is ok to use; False values arise from being unable to | |
531 | write the file | |
532 | ||
533 | \membersection{wxSVGFileDC::ResetBoundingBox}\label{wxdcresetboundingbox} | |
534 | ||
535 | \func{void}{ResetBoundingBox}{\void} | |
536 | ||
537 | Resets the bounding box: after a call to this function, the bounding box | |
538 | doesn't contain anything. | |
539 | ||
540 | \wxheading{See also} | |
541 | ||
542 | \helpref{CalcBoundingBox}{wxdccalcboundingbox} | |
543 | ||
544 | \membersection{wxSVGFileDC::SetAxisOrientation}\label{wxdcsetaxisorientation} | |
545 | ||
546 | \func{void}{SetAxisOrientation}{\param{bool}{ xLeftRight}, | |
547 | \param{bool}{ yBottomUp}} | |
548 | ||
549 | Sets the x and y axis orientation (i.e., the direction from lowest to | |
550 | highest values on the axis). The default orientation is the natural | |
551 | orientation, e.g. x axis from left to right and y axis from bottom up. | |
552 | ||
553 | \wxheading{Parameters} | |
554 | ||
555 | \docparam{xLeftRight}{True to set the x axis orientation to the natural | |
556 | left to right orientation, false to invert it.} | |
557 | ||
558 | \docparam{yBottomUp}{True to set the y axis orientation to the natural | |
559 | bottom up orientation, false to invert it.} | |
560 | ||
561 | \membersection{wxSVGFileDC::SetDeviceOrigin}\label{wxdcsetdeviceorigin} | |
562 | ||
563 | \func{void}{SetDeviceOrigin}{\param{wxCoord}{ x}, \param{wxCoord}{ y}} | |
564 | ||
565 | Sets the device origin (i.e., the origin in pixels after scaling has been | |
566 | applied). | |
567 | ||
568 | This function may be useful in Windows printing | |
569 | operations for placing a graphic on a page. | |
570 | ||
571 | \membersection{wxSVGFileDC::SetBackground}\label{wxdcsetbackground} | |
572 | ||
573 | \func{void}{SetBackground}{\param{const wxBrush\& }{brush}} | |
574 | ||
575 | Sets the current background brush for the DC. | |
576 | ||
577 | \membersection{wxSVGFileDC::SetBackgroundMode}\label{wxdcsetbackgroundmode} | |
578 | ||
579 | \func{void}{SetBackgroundMode}{\param{int}{ mode}} | |
580 | ||
581 | {\it mode} may be one of wxSOLID and wxTRANSPARENT. This setting determines | |
582 | whether text will be drawn with a background colour or not. | |
583 | ||
584 | \membersection{wxSVGFileDC::SetClippingRegion}\label{wxdcsetclippingregion} | |
585 | ||
586 | \func{void}{SetClippingRegion}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}} | |
587 | ||
588 | \func{void}{SetClippingRegion}{\param{const wxPoint\& }{pt}, \param{const wxSize\& }{sz}} | |
589 | ||
590 | \func{void}{SetClippingRegion}{\param{const wxRect\&}{ rect}} | |
591 | ||
592 | \func{void}{SetClippingRegion}{\param{const wxRegion\&}{ region}} | |
593 | ||
594 | Not implemented | |
595 | ||
596 | ||
597 | \membersection{wxSVGFileDC::SetPalette}\label{wxdcsetpalette} | |
598 | ||
599 | \func{void}{SetPalette}{\param{const wxPalette\& }{palette}} | |
600 | ||
601 | Not implemented | |
602 | ||
603 | \membersection{wxSVGFileDC::SetBrush}\label{wxdcsetbrush} | |
604 | ||
605 | \func{void}{SetBrush}{\param{const wxBrush\& }{brush}} | |
606 | ||
607 | Sets the current brush for the DC. | |
608 | ||
609 | If the argument is wxNullBrush, the current brush is selected out of the device | |
610 | context, and the original brush restored, allowing the current brush to | |
611 | be destroyed safely. | |
612 | ||
613 | See also \helpref{wxBrush}{wxbrush}. | |
614 | ||
615 | See also \helpref{wxMemoryDC}{wxmemorydc} for the interpretation of colours | |
616 | when drawing into a monochrome bitmap. | |
617 | ||
618 | \membersection{wxSVGFileDC::SetFont}\label{wxdcsetfont} | |
619 | ||
620 | \func{void}{SetFont}{\param{const wxFont\& }{font}} | |
621 | ||
622 | Sets the current font for the DC. It must be a valid font, in particular you | |
623 | should not pass {\tt wxNullFont} to this method. | |
624 | ||
625 | See also \helpref{wxFont}{wxfont}. | |
626 | ||
627 | \membersection{wxSVGFileDC::SetLogicalFunction}\label{wxdcsetlogicalfunction} | |
628 | ||
629 | \func{void}{SetLogicalFunction}{\param{int}{ function}} | |
630 | ||
631 | ||
632 | Only wxCOPY is avalaible; trying to set one of the othe values will fail | |
633 | ||
634 | \membersection{wxSVGFileDC::SetMapMode}\label{wxdcsetmapmode} | |
635 | ||
636 | \func{void}{SetMapMode}{\param{int}{ int}} | |
637 | ||
638 | The {\it mapping mode} of the device context defines the unit of | |
639 | measurement used to convert logical units to device units. Note that | |
640 | in X, text drawing isn't handled consistently with the mapping mode; a | |
641 | font is always specified in point size. However, setting the {\it | |
642 | user scale} (see \helpref{wxSVGFileDC::SetUserScale}{wxdcsetuserscale}) scales the text appropriately. In | |
643 | Windows, scaleable TrueType fonts are always used; in X, results depend | |
644 | on availability of fonts, but usually a reasonable match is found. | |
645 | ||
646 | Note that the coordinate origin should ideally be selectable, but for | |
647 | now is always at the top left of the screen/printer. | |
648 | ||
649 | Drawing to a Windows printer device context under UNIX | |
650 | uses the current mapping mode, but mapping mode is currently ignored for | |
651 | PostScript output. | |
652 | ||
653 | The mapping mode can be one of the following: | |
654 | ||
655 | \begin{twocollist}\itemsep=0pt | |
656 | \twocolitem{wxMM\_TWIPS}{Each logical unit is 1/20 of a point, or 1/1440 of | |
657 | an inch.} | |
658 | \twocolitem{wxMM\_POINTS}{Each logical unit is a point, or 1/72 of an inch.} | |
659 | \twocolitem{wxMM\_METRIC}{Each logical unit is 1 mm.} | |
660 | \twocolitem{wxMM\_LOMETRIC}{Each logical unit is 1/10 of a mm.} | |
661 | \twocolitem{wxMM\_TEXT}{Each logical unit is 1 pixel.} | |
662 | \end{twocollist} | |
663 | ||
664 | \membersection{wxSVGFileDC::SetOptimization}\label{wxsetoptimization} | |
665 | ||
666 | \func{void}{SetOptimization}{\param{bool }{optimize}} | |
667 | ||
668 | Does nothing | |
669 | ||
670 | \membersection{wxSVGFileDC::SetPen}\label{wxdcsetpen} | |
671 | ||
672 | \func{void}{SetPen}{\param{const wxPen\& }{pen}} | |
673 | ||
674 | Sets the current pen for the DC. | |
675 | ||
676 | If the argument is wxNullPen, the current pen is selected out of the device | |
677 | context, and the original pen restored. | |
678 | ||
679 | See also \helpref{wxMemoryDC}{wxmemorydc} for the interpretation of colours | |
680 | when drawing into a monochrome bitmap. | |
681 | ||
682 | \membersection{wxSVGFileDC::SetTextBackground}\label{wxdcsettextbackground} | |
683 | ||
684 | \func{void}{SetTextBackground}{\param{const wxColour\& }{colour}} | |
685 | ||
686 | Sets the current text background colour for the DC. | |
687 | ||
688 | \membersection{wxSVGFileDC::SetTextForeground}\label{wxdcsettextforeground} | |
689 | ||
690 | \func{void}{SetTextForeground}{\param{const wxColour\& }{colour}} | |
691 | ||
692 | Sets the current text foreground colour for the DC. | |
693 | ||
694 | See also \helpref{wxMemoryDC}{wxmemorydc} for the interpretation of colours | |
695 | when drawing into a monochrome bitmap. | |
696 | ||
697 | \membersection{wxSVGFileDC::SetUserScale}\label{wxdcsetuserscale} | |
698 | ||
699 | \func{void}{SetUserScale}{\param{double}{ xScale}, \param{double}{ yScale}} | |
700 | ||
701 | Sets the user scaling factor, useful for applications which require | |
702 | `zooming'. | |
703 | ||
704 | \membersection{wxSVGFileDC::StartDoc}\label{wxdcstartdoc} | |
705 | ||
706 | \func{bool}{StartDoc}{\param{const wxString\& }{message}} | |
707 | ||
708 | Does nothing | |
709 | ||
710 | \membersection{wxSVGFileDC::StartPage}\label{wxdcstartpage} | |
711 | ||
712 | \func{bool}{StartPage}{\void} | |
713 | ||
714 | Does nothing |