| 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_ROTIMAGE"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>RotImage</b> EXTENDS <a href="Image.html#_C_IMAGE" style="font-face:arial;font-weight:bold;">Image</a></div>
|
|
|
9 |
<i>(Defined in: jpgraph.php : 7530)</i><table border=1><tr><td> <a href="RotImage.html" style="font-family:arial;font-weight:bold;color:darkblue;">RotImage</a> </td><td> <a href="Image.html" style="font-family:arial;font-weight:bold;color:darkblue;">Image</a> </td></tr><tr><td valign=top> <a href="RotImage.html#_ROTIMAGE_SETANGLE">SetAngle()</a> <br>
|
|
|
10 |
<a href="RotImage.html#_ROTIMAGE_SETCENTER">SetCenter()</a> <br>
|
|
|
11 |
<a href="RotImage.html#_ROTIMAGE_SETMARGIN">SetMargin()</a> <br>
|
|
|
12 |
<a href="RotImage.html#_ROTIMAGE_SETTRANSLATION">SetTranslation()</a> <br>
|
|
|
13 |
</td><td valign=top> <a href="Image.html#_IMAGE_ROUNDEDRECTANGLE">RoundedRectangle()</a> <br>
|
|
|
14 |
<a href="Image.html#_IMAGE_SETALPHABLENDING">SetAlphaBlending()</a> <br>
|
|
|
15 |
<a href="Image.html#_IMAGE_SETANTIALIASING">SetAntiAliasing()</a> <br>
|
|
|
16 |
<a href="Image.html#_IMAGE_SETCANVASCOLOR">SetCanvasColor()</a> <br>
|
|
|
17 |
<a href="Image.html#_IMAGE_SETEXPIRED">SetExpired()</a> <br>
|
|
|
18 |
<a href="Image.html#_IMAGE_SETIMGFORMAT">SetImgFormat()</a> <br>
|
|
|
19 |
<a href="Image.html#_IMAGE_SETMARGIN" style="color:darkgrey;">SetMargin() </a><br>
|
|
|
20 |
<a href="Image.html#_IMAGE_SETQUALITY">SetQuality()</a> <br>
|
|
|
21 |
<a href="Image.html#_IMAGE_SETTRANSPARENT">SetTransparent()</a> <br>
|
|
|
22 |
</td></tr></table> <p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>A subclass of Image class which implements a rotated version of all methods in the base Image class.
|
|
|
23 |
|
|
|
24 |
The Image class used in JpGraph is actually not the class Image but rather this class as we want to have the rotating possibility.
|
|
|
25 |
|
|
|
26 |
The rotation is accomplished by standard 2D rotation matrices. <p>
|
|
|
27 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="Image.html">Image</a> <p> <hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
|
|
|
28 |
<p> <p> <span style='font-size:110%;'><a name="_ROTIMAGE_SETANGLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
29 |
function SetAngle($a)</font>
|
|
|
30 |
</b></div></a></span>
|
|
|
31 |
|
|
|
32 |
<span style='font-family:arial;font-size:90%;'><i>Specify rotation angle</i></span><p>
|
|
|
33 |
|
|
|
34 |
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
|
35 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
36 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
37 |
$a</font>
|
|
|
38 |
|
|
|
39 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Angle in degrees</td></tr>
|
|
|
40 |
</table>
|
|
|
41 |
|
|
|
42 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the rotation angle for the other graphic primitives in this class.
|
|
|
43 |
|
|
|
44 |
The rotation is performed around point (0,0).
|
|
|
45 |
<br>
|
|
|
46 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="RotImage.html#_ROTIMAGE_SETTRANSLATION">RotImage::SetTranslation</a> and <a href="RotImage.html#_ROTIMAGE_SETCENTER">RotImage::SetCenter</a>
|
|
|
47 |
<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">
|
|
|
48 |
$graph->img->SetAngle(45);
<br /></font>
|
|
|
49 |
</span><br>
|
|
|
50 |
<p>
|
|
|
51 |
<p> <p> <span style='font-size:110%;'><a name="_ROTIMAGE_SETCENTER"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
52 |
function SetCenter($dx,$dy)</font>
|
|
|
53 |
</b></div></a></span>
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
59 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
60 |
$dx</font>
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
$dy</font>
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
</table>
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
<br>
|
|
|
72 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="RotImage.html#_ROTIMAGE_SETTRANSLATION">RotImage::SetTranslation</a> and <a href="RotImage.html#_ROTIMAGE_SETANGLE">RotImage::SetAngle</a>
|
|
|
73 |
<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">
|
|
|
74 |
$width=600; $height=400;
<br />$graph = new Graph($width,$height);
<br />$graph->img->SetMargin($leftm,$rightm,$topm,$bottomm);
<br />$graph->SetAngle(20);
<br />
<br />// Rotate graph around the plots (0,0) point, i.e
<br />// where the graph axis intersect.
<br />$graph->img->SetCenter($leftm,$height-($topm+$bottomm));
<br /></font>
|
|
|
75 |
</span><br>
|
|
|
76 |
<p>
|
|
|
77 |
<p> <p> <span style='font-size:110%;'><a name="_ROTIMAGE_SETMARGIN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
78 |
function SetMargin($lm,$rm,$tm,$bm)</font>
|
|
|
79 |
</b></div></a></span>
|
|
|
80 |
|
|
|
81 |
<span style='font-family:arial;font-size:90%;'><i>Specify margin for plot</i></span><p>
|
|
|
82 |
|
|
|
83 |
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
|
84 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
85 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
86 |
$lm</font>
|
|
|
87 |
|
|
|
88 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Left margin</td></tr>
|
|
|
89 |
|
|
|
90 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Right margin</td></tr>
|
|
|
94 |
|
|
|
95 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
</table>
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
<br>
|
|
|
108 |
|
|
|
109 |
<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">
|
|
|
110 |
$graph->img->SetMargin(30,30,50,20);
<br /></font>
|
|
|
111 |
|
|
|
112 |
<p>
|
|
|
113 |
<p> <p> <span style='font-size:110%;'><a name="_ROTIMAGE_SETTRANSLATION"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
114 |
|
|
|
115 |
</b></div></a></span>
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
|
120 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
121 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
122 |
$dx</font>
|
|
|
123 |
|
|
|
124 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Horizontal translation</td></tr>
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
$dy</font>
|
|
|
128 |
|
|
|
129 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Vertical translation</td></tr>
|
|
|
130 |
</table>
|
|
|
131 |
|
|
|
132 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>The translation is applied after the rotation of the image. <br>
|
|
|
133 |
|
|
|
134 |
<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">
|
|
|
135 |
|
|
|
136 |
</span><br>
|
|
|
137 |
<p> <hr> <p>
|