Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<style type="text/css">
2
		<!--
3
		A:link        {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
4
		A:visited     {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
5
		A:hover       {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: underline; color: #FF0000}
6
		th            {font-family: helvetica, arial; color : blue; font-size:85%; background : lightgrey; border-right:black solid 1pt; border-bottom:black solid 1pt;}
7
		//-->
8
		</style><hr><a name="_C_SHAPE"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>Shape</b></div>
9
<i>(Defined in: jpgraph_canvtools.php : 69)</i><table border=1><tr><td>&nbsp;<a href="Shape.html" style="font-family:arial;font-weight:bold;color:darkblue;">Shape</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="Shape.html#_SHAPE_BEZIER">Bezier()</a>&nbsp;<br>
10
&nbsp;<a href="Shape.html#_SHAPE_CIRCLE">Circle()</a>&nbsp;<br>
11
&nbsp;<a href="Shape.html#_SHAPE_FILLEDCIRCLE">FilledCircle()</a>&nbsp;<br>
12
&nbsp;<a href="Shape.html#_SHAPE_FILLEDPOLYGON">FilledPolygon()</a>&nbsp;<br>
13
&nbsp;<a href="Shape.html#_SHAPE_FILLEDRECTANGLE">FilledRectangle()</a>&nbsp;<br>
14
&nbsp;<a href="Shape.html#_SHAPE_FILLEDROUNDEDRECTANGLE">FilledRoundedRectangle()</a>&nbsp;<br>
15
&nbsp;<a href="Shape.html#_SHAPE_INDENTEDRECTANGLE">IndentedRectangle()</a>&nbsp;<br>
16
&nbsp;<a href="Shape.html#_SHAPE_LINE">Line()</a>&nbsp;<br>
17
&nbsp;<a href="Shape.html#_SHAPE_POLYGON">Polygon()</a>&nbsp;<br>
18
&nbsp;<a href="Shape.html#_SHAPE_RECTANGLE">Rectangle()</a>&nbsp;<br>
19
&nbsp;<a href="Shape.html#_SHAPE_ROUNDEDRECTANGLE">RoundedRectangle()</a>&nbsp;<br>
20
&nbsp;<a href="Shape.html#_SHAPE_SETCOLOR">SetColor()</a>&nbsp;<br>
21
&nbsp;<a href="Shape.html#_SHAPE_SETTEXTALIGN">SetTextAlign()</a>&nbsp;<br>
22
&nbsp;<a href="Shape.html#_SHAPE_SHADOWRECTANGLE">ShadowRectangle()</a>&nbsp;<br>
23
&nbsp;<a href="Shape.html#_SHAPE_SHAPE">Shape()</a>&nbsp;<br>
24
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>This is mainly awrapper class around thye current image class used. It is meant to make it easier to work with a Canvas graph and a Canvas scale. Basically the class uses the specified scale to trasnalte coordinates which is then passed on to the standard Image routines.
25
 <p> &nbsp;
26
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="CanvasScale.html">CanvasScale</a> <p> &nbsp;<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
27
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_BEZIER"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
28
function&nbsp;Bezier($p,$aSteps)</font>
29
</b></div></a></span>
30
 
31
<span style='font-family:arial;font-size:90%;'><i>Draw a bezier curve </i></span><p>
32
 
33
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
34
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
35
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
36
$p</font>
37
 
38
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Array with control points</td></tr>
39
 
40
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
41
$aSteps</font>
42
 
43
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
44
40</font>
45
</td><td>Number of line segments in curve</td></tr>
46
</table>
47
 
48
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Draw a Bezier line with specified in the $p array. The points are specified according to the current scale. The positions in the array has the following meaning
49
<p>
50
(0,1) x0,y0 (First point on curver)<br>
51
(2,3) x,y, (Control point 1)<br>
52
(4,5) x,y, (Control point 2)<br>
53
(6,7) x,y, (End point of curve)<br>
54
<p>
55
See example in canvasbezierex1.php
56
 
57
&nbsp;<br>
58
 
59
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
60
$p&nbsp;=&nbsp;array(3,6,6,9,5,3,7,4);
<br />
<br />$shape-&gt;SetColor('black');
<br />$shape-&gt;Bezier($p);
<br /></font>
61
</span><br>
62
<p>
63
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_CIRCLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
64
function&nbsp;Circle($x1,$y1,$r)</font>
65
</b></div></a></span>
66
67
<span style='font-family:arial;font-size:90%;'><i>Draw a circle</i></span><p>
68
69
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
70
 
71
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
72
 
73
74
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Center X-coordinate</td></tr>
75
76
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
77
 
78
79
 
80
81
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
82
 
83
84
 
85
</table>
86
87
 
88
&nbsp;<br>
89
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Image.html#_IMAGE_CIRCLE">Image::Circle</a>
90
 
91
//&nbsp;The&nbsp;shape&nbsp;class&nbsp;is&nbsp;wrapper&nbsp;around&nbsp;the&nbsp;Imgae&nbsp;class&nbsp;which&nbsp;translates
<br />//&nbsp;the&nbsp;coordinates&nbsp;for&nbsp;us
<br />$shape&nbsp;=&nbsp;new&nbsp;Shape($g,$scale);
<br />$shape-&gt;SetColor('black');
<br />
<br />
<br />//&nbsp;..&nbsp;and&nbsp;a&nbsp;circle&nbsp;(x,y,diameter)
<br />$shape-&gt;Circle(5,14,2);
<br />
<br /></font>
92
</span><br>
93
<p>
94
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_FILLEDCIRCLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
95
function&nbsp;FilledCircle($x1,$y1,$r)</font>
96
</b></div></a></span>
97
98
<span style='font-family:arial;font-size:90%;'><i>Draw a filled circle to a canvas</i></span><p>
99
100
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
101
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
102
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
103
$x1</font>
104
105
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Center X-coordinate</td></tr>
106
107
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
108
$y1</font>
109
110
 
111
112
 
113
$r</font>
114
115
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Radius</td></tr>
116
</table>
117
 
118
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Draw a filled circle on the canvas using the specified scale.
119
 
120
Note: If you are using GD1.xx you will see moire-patterns in large circles. This is due to the lack of a proper filled circle function in GD 1.xx. Using GD 2.xx will avoid this problem.
121
&nbsp;<br>
122
 
123
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
124
 
125
</span><br>
126
<p>
127
 
128
function&nbsp;FilledPolygon($p)</font>
129
</b></div></a></span>
130
 
131
<span style='font-family:arial;font-size:90%;'><i>Draw a filled polygon</i></span><p>
132
133
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
134
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
135
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
136
$p</font>
137
138
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Polygon array</td></tr>
139
</table>
140
141
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Draw a filled polygon&nbsp;<br>
142
<p>
143
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_FILLEDRECTANGLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
144
function&nbsp;FilledRectangle($x1,$y1,$x2,$y2)</font>
145
</b></div></a></span>
146
147
<span style='font-family:arial;font-size:90%;'><i>Draw a filled rectangle on the canvas</i></span><p>
148
149
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
150
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
151
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
152
 
153
154
 
155
156
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
157
$y1</font>
158
159
 
160
161
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
162
 
163
164
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right X</td></tr>
165
166
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
167
$y2</font>
168
 
169
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right Y</td></tr>
170
 
171
172
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Draw a filled rectangle on the canvas using the current sclae.
173
&nbsp;<br>
174
175
 
176

<br />//&nbsp;..&nbsp;add&nbsp;a&nbsp;rectangle
<br />$shape-&gt;SetColor('green');
<br />$shape-&gt;FilledRectangle(15,8,19,14);
<br /></font>
177
 
178
<p>
179
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_FILLEDROUNDEDRECTANGLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
180
 
181
</b></div></a></span>
182
 
183
<span style='font-family:arial;font-size:90%;'><i>Create a filled rectangle with rounded corners</i></span><p>
184
185
 
186
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
187
 
188
$x1</font>
189
190
 
191
192
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
193
 
194
195
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left Y</td></tr>
196
 
197
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
198
 
199
200
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right X</td></tr>
201
202
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
203
$y2</font>
204
205
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right Y</td></tr>
206
207
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
208
 
209
210
 
211
null</font>
212
</td><td>Corner radius</td></tr>
213
</table>
214
215
 
216
<p>
217
 
218
function&nbsp;IndentedRectangle($xt,$yt,$w,$h,$iw,$ih,$aCorner,$aFillColor,$r)</font>
219
</b></div></a></span>
220
 
221
<span style='font-family:arial;font-size:90%;'><i>A filled rectangle with one corner 'indented'</i></span><p>
222
 
223
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
224
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
225
 
226
$xt</font>
227
 
228
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left X</td></tr>
229
230
 
231
$yt</font>
232
 
233
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left Y</td></tr>
234
235
 
236
$w</font>
237
238
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Width</td></tr>
239
240
 
241
$h</font>
242
243
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Height</td></tr>
244
245
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
246
 
247
248
 
249
0</font>
250
</td><td>Indented width</td></tr>
251
252
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
253
 
254
255
 
256
0</font>
257
</td><td>Indeted height</td></tr>
258
 
259
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
260
 
261
262
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
263
 
264
</td><td>Corner to indent</td></tr>
265
 
266
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
267
$aFillColor</font>
268
 
269
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
270
 
271
</td><td>Fill color</td></tr>
272
273
 
274
$r</font>
275
276
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
277
 
278
</td><td>Corner radius</td></tr>
279
</table>
280
 
281
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>A rounded rectangle where one of the corner has been moved "into" the rectangle. The indention is determined by the two argument
282
'iw' width and 'ih' height.
283
<p>
284
 
285
0=Top left, 1=top right, 2=bottom right, 3=bottom left
286
&nbsp;<br>
287
 
288
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_LINE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
289
function&nbsp;Line($x1,$y1,$x2,$y2)</font>
290
</b></div></a></span>
291
 
292
<span style='font-family:arial;font-size:90%;'><i>Draw a line between</i></span><p>
293
294
 
295
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
296
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
297
$x1</font>
298
 
299
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>X1</td></tr>
300
301
 
302
$y1</font>
303
304
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Y1</td></tr>
305
306
 
307
$x2</font>
308
309
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>X2</td></tr>
310
311
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
312
$y2</font>
313
314
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Y2</td></tr>
315
</table>
316
317
 
318
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Image.html#_IMAGE_LINE">Image::Line</a>
319
 
320

<br />//&nbsp;Add&nbsp;a&nbsp;black&nbsp;line
<br />$shape-&gt;SetColor('black');
<br />$shape-&gt;Line(0,0,20,20);
<br /></font>
321
</span><br>
322
<p>
323
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_POLYGON"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
324
 
325
</b></div></a></span>
326
 
327
<span style='font-family:arial;font-size:90%;'><i>Draw a closed polygon</i></span><p>
328
329
 
330
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
331
 
332
$p</font>
333
334
 
335
336
 
337
$aClosed</font>
338
339
 
340
false</font>
341
</td><td>No description available</td></tr>
342
 
343
344
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Draw a closed polygon&nbsp;<br>
345
346
 
347
$p&nbsp;=&nbsp;array(3,6,6,9,5,3,7,4);
<br />$shape-&gt;SetColor('blue:0.35');
<br />$shape-&gt;Polygon($p);</font>
348
</span><br>
349
<p>
350
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_RECTANGLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
351
function&nbsp;Rectangle($x1,$y1,$x2,$y2)</font>
352
</b></div></a></span>
353
354
<span style='font-family:arial;font-size:90%;'><i>Draw a rectangle on the canvas</i></span><p>
355
356
 
357
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
358
 
359
$x1</font>
360
361
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left X</td></tr>
362
363
 
364
$y1</font>
365
 
366
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left Y</td></tr>
367
368
 
369
$x2</font>
370
371
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right X</td></tr>
372
373
 
374
$y2</font>
375
 
376
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right Y</td></tr>
377
</table>
378
379
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Draw a rectangle on the canvas using the current scale.&nbsp;<br>
380
381
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
382
//&nbsp;..&nbsp;add&nbsp;a&nbsp;rectangle
<br />$shape-&gt;SetColor('green');
<br />$shape-&gt;Rectangle(15,8,19,14);
<br /></font>
383
</span><br>
384
<p>
385
 
386
function&nbsp;RoundedRectangle($x1,$y1,$x2,$y2,$r)</font>
387
 
388
389
<span style='font-family:arial;font-size:90%;'><i>Draw a rectangle with rounded corners</i></span><p>
390
391
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
392
 
393
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
394
 
395
396
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left X</td></tr>
397
 
398
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
399
 
400
401
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left Y</td></tr>
402
 
403
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
404
 
405
406
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right X</td></tr>
407
 
408
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
409
$y2</font>
410
 
411
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right Y</td></tr>
412
 
413
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
414
$r</font>
415
416
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
417
null</font>
418
</td><td>Corner radius</td></tr>
419
</table>
420
421
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Draw a rectangle with rounded corners&nbsp;<br>
422
<p>
423
 
424
function&nbsp;SetColor($aColor)</font>
425
 
426
427
<span style='font-family:arial;font-size:90%;'><i>Specify color to use when drawing shapes</i></span><p>
428
429
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
430
 
431
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
432
 
433
434
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Color specification</td></tr>
435
 
436
437
 
438
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="RGB.html#_RGB_COLOR">RGB::Color</a>
439
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
440
 
441
</span><br>
442
 
443
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_SETTEXTALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
444
function&nbsp;SetTextAlign($halign,$valign)</font>
445
 
446
447
 
448
449
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
450
 
451
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
452
$halign</font>
453
454
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Horizontal position for basepoint</td></tr>
455
 
456
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
457
$valign</font>
458
459
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
460
"bottom"</font>
461
 
462
</table>
463
 
464
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specifies how the coordinate for the text should be interpretated. Possible values for horizontal base-position are
465
466
<ul>
467
<li> "left"
468
 
469
<li> "right"
470
</ul>
471
 
472
and for vertical
473
474
475
<ul>
476
<li> "top"
477
<li> "center"
478
<li> "bottom"
479
</ul>
480
&nbsp;<br>
481
482
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
483
//&nbsp;Interpret&nbsp;the&nbsp;text&nbsp;coordinate&nbsp;as&nbsp;beeing&nbsp;the
<br />//&nbsp;top&nbsp;left&nbsp;corner&nbsp;of&nbsp;the&nbsp;bounding&nbsp;box&nbsp;for&nbsp;the&nbsp;text
<br />$shape-&gt;SetTextAlign('left','top');
<br />
<br />$shape-&gt;StrokeText(....)
<br /></font>
484
 
485
<p>
486
 
487
function&nbsp;ShadowRectangle($x1,$y1,$x2,$y2,$fcolor,$shadow_width,$shadow_color)</font>
488
</b></div></a></span>
489
490
<span style='font-family:arial;font-size:90%;'><i>Draw a filled rectangle with a drop shadow</i></span><p>
491
 
492
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
493
 
494
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
495
$x1</font>
496
 
497
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left X</td></tr>
498
499
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
500
$y1</font>
501
 
502
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top left Y</td></tr>
503
 
504
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
505
$x2</font>
506
507
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Bottom right X</td></tr>
508
509
 
510
$y2</font>
511
 
512
 
513
514
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
515
$fcolor</font>
516
517
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
518
false</font>
519
 
520
521
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
522
$shadow_width</font>
523
524
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
525
null</font>
526
</td><td>Shadow width</td></tr>
527
528
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
529
$shadow_color</font>
530
531
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
532
 
533
</td><td>Shadow color</td></tr>
534
 
535
536
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Draw a filled rectangle with a drop shadow&nbsp;<br>
537
<p>
538
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_SHAPE_SHAPE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
539
 
540
</b></div></a></span>
541
 
542
<span style='font-family:arial;font-size:90%;'><i>Methods to draw shapes on canvas</i></span><p>
543
544
 
545
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
546
 
547
&amp;$aGraph</font>
548
549
 
550
551
 
552
&amp;$scale</font>
553
554
 
555
</table>
556
 
557
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Create a new shape class used to draw siple shape onto a canvas using the specified scale.&nbsp;<br>
558
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="CanvasGraph.html#_CANVASGRAPH_CANVASGRAPH">CanvasGraph::CanvasGraph</a> and <a href="CanvasScale.html#_CANVASSCALE_CANVASSCALE">CanvasScale::CanvasScale</a>
559
 
560
//&nbsp;Setup&nbsp;a&nbsp;basic&nbsp;canvas&nbsp;we&nbsp;can&nbsp;work&nbsp;
<br />$g&nbsp;=&nbsp;new&nbsp;CanvasGraph(400,200,'auto');
<br />$g-&gt;SetMargin(5,11,6,11);
<br />$g-&gt;SetShadow();
<br />$g-&gt;SetMarginColor("teal");
<br />
<br />//&nbsp;We&nbsp;need&nbsp;to&nbsp;stroke&nbsp;the&nbsp;plotarea&nbsp;and&nbsp;margin&nbsp;before&nbsp;we&nbsp;add&nbsp;the
<br />//&nbsp;text&nbsp;since&nbsp;we&nbsp;otherwise&nbsp;would&nbsp;overwrite&nbsp;the&nbsp;text.
<br />$g-&gt;InitFrame();
<br />
<br />//&nbsp;Create&nbsp;a&nbsp;new&nbsp;scale
<br />$scale&nbsp;=&nbsp;new&nbsp;CanvasScale($g);
<br />$scale-&gt;Set(0,$xmax,0,$ymax);
<br />
<br />//&nbsp;The&nbsp;shape&nbsp;class&nbsp;is&nbsp;wrapper&nbsp;around&nbsp;the&nbsp;Imgae&nbsp;class&nbsp;which&nbsp;translates
<br />//&nbsp;the&nbsp;coordinates&nbsp;for&nbsp;us
<br />$shape&nbsp;=&nbsp;new&nbsp;Shape($g,$scale);
<br /></font>
561
</span><br>
562
<p> <hr> <p>