147 lines
15 KiB
HTML
147 lines
15 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><style type="text/css">
|
||
|
<!--
|
||
|
A:link {font-family: helvetica, arial, geneva, sans-serif; font-size: small; text-decoration: none; color: #000000}
|
||
|
A:visited {font-family: helvetica, arial, geneva, sans-serif; font-size: small; text-decoration: none; color: #000000}
|
||
|
A:hover {font-family: helvetica, arial, geneva, sans-serif; font-size: small; text-decoration: underline; color: #FF0000}
|
||
|
A.no:link {font-family:inherit; font-size: inhreit;text-decoration: none; color: #000000}
|
||
|
A.no:visited {font-family:inherit; font-size: inherit;text-decoration: none; color: #000000}
|
||
|
A.no:hover {font-family:inherit; font-size: inherit;text-decoration: none; color: #000000}
|
||
|
th {font-family: helvetica, arial; color : black; font-size:90%; background : #b7c8b7; border-right:black solid 1pt; border-bottom:black solid 1pt;}
|
||
|
td {font-family: helvetica, arial; color : black; font-size:90%; background : white; border-right:black solid 1pt; border-bottom:black solid 1pt;}
|
||
|
|
||
|
//-->
|
||
|
</style></HEAD><hr><div style="padding-left:4px;border-left:solid black 1px;border-top:solid black 1px;border-bottom:solid black 2px;border-right:solid black 2px;background-color:#deaa87;font-family:courier new;font-size:16pt;">Class <a class="no" name="_C_ROTIMAGE"><b>RotImage</b></a> Extends <a style="font-size:14pt;text-decoration:underline;"href="Image.html#_C_IMAGE" style="font-face:arial;font-weight:bold;">Image</a></div>
|
||
|
<i>(Defined in: jpgraph.php : 7530)</i><br> <br><table cellspaceing=0 cellpadding=4 style="border:solid #303030 1px;"><tr><td align="center" style="background:lightgray;" > <a href="RotImage.html" style="font-family:arial;font-weight:bold;color:darkblue;">RotImage</a> </td><td align="center" style="background:lightgray;" > <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>
|
||
|
<a href="RotImage.html#_ROTIMAGE_SETCENTER">SetCenter()</a> <br>
|
||
|
<a href="RotImage.html#_ROTIMAGE_SETMARGIN">SetMargin()</a> <br>
|
||
|
<a href="RotImage.html#_ROTIMAGE_SETTRANSLATION">SetTranslation()</a> <br>
|
||
|
</td><td valign=top> <a href="Image.html#_IMAGE_ROUNDEDRECTANGLE">RoundedRectangle()</a> <br>
|
||
|
<a href="Image.html#_IMAGE_SETALPHABLENDING">SetAlphaBlending()</a> <br>
|
||
|
<a href="Image.html#_IMAGE_SETANTIALIASING">SetAntiAliasing()</a> <br>
|
||
|
<a href="Image.html#_IMAGE_SETCANVASCOLOR">SetCanvasColor()</a> <br>
|
||
|
<a href="Image.html#_IMAGE_SETEXPIRED">SetExpired()</a> <br>
|
||
|
<a href="Image.html#_IMAGE_SETIMGFORMAT">SetImgFormat()</a> <br>
|
||
|
<a href="Image.html#_IMAGE_SETMARGIN" style="color:darkgrey;">SetMargin() </a><br>
|
||
|
<a href="Image.html#_IMAGE_SETQUALITY">SetQuality()</a> <br>
|
||
|
<a href="Image.html#_IMAGE_SETTRANSPARENT">SetTransparent()</a> <br>
|
||
|
</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.
|
||
|
|
||
|
The Image class used in JpGraph is actually not the class Image but rather this class as we want to have the rotating possibility.
|
||
|
|
||
|
The rotation is accomplished by standard 2D rotation matrices. <p>
|
||
|
<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>
|
||
|
<p> <div style='font-family: helvetica, arial, geneva, sans-serif;margin-bottom:4px;border-left:solid black 1px;border-top:solid black 1px;border-bottom:solid black 2px;border-right:solid black 2px;font-size:120%;background:#dde9af;padding:4px;'><a class="no" name="_ROTIMAGE_SETANGLE"><span style="color:#555555;">RotImage ::</span><br><b>SetAngle</b>($a)</a></div>
|
||
|
|
||
|
<span style='font-family:arial;font-size:95%;'><i>Specify rotation angle</i></span><p>
|
||
|
|
||
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
||
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$a</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Angle in degrees</td></tr>
|
||
|
</table>
|
||
|
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;">Description:</div>Specify the rotation angle for the other graphic primitives in this class.
|
||
|
|
||
|
The rotation is performed around point (0,0).
|
||
|
<br>
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;">See also:</div><ul><li><a href="RotImage.html#_ROTIMAGE_SETTRANSLATION">RotImage::SetTranslation()</a><li><a href="RotImage.html#_ROTIMAGE_SETCENTER">RotImage::SetCenter()</a></ul>
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;"><p>Example:</div><div style="padding:5px;border:dashed gray 1px;background-color:#f3f3f3;font-family:courier new;font-size:90%;font-weight:bold;"><b><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$graph</span><span style="color: #007700">-></span><span style="color: #0000BB">img</span><span style="color: #007700">-></span><span style="color: #0000BB">SetAngle</span><span style="color: #007700">(</span><span style="color: #0000BB">45</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB"></span>
|
||
|
</span>
|
||
|
</b></div><br>
|
||
|
<p>
|
||
|
<p> <div style='font-family: helvetica, arial, geneva, sans-serif;margin-bottom:4px;border-left:solid black 1px;border-top:solid black 1px;border-bottom:solid black 2px;border-right:solid black 2px;font-size:120%;background:#dde9af;padding:4px;'><a class="no" name="_ROTIMAGE_SETCENTER"><span style="color:#555555;">RotImage ::</span><br><b>SetCenter</b>($dx, $dy)</a></div>
|
||
|
|
||
|
<span style='font-family:arial;font-size:95%;'><i>Set rotation center</i></span><p>
|
||
|
|
||
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
||
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$dx</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Specify rotation center X</td></tr>
|
||
|
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$dy</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Specify rotation center Y</td></tr>
|
||
|
</table>
|
||
|
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;">Description:</div>Specify center of rotation. (0,0) is the upper left most point in the image. By default the rotation point is choosen as tjhe midpoint of the image when the RotImage class is initially created.
|
||
|
<br>
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;">See also:</div><ul><li><a href="RotImage.html#_ROTIMAGE_SETTRANSLATION">RotImage::SetTranslation()</a><li><a href="RotImage.html#_ROTIMAGE_SETANGLE">RotImage::SetAngle()</a></ul>
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;"><p>Example:</div><div style="padding:5px;border:dashed gray 1px;background-color:#f3f3f3;font-family:courier new;font-size:90%;font-weight:bold;"><b><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$width</span><span style="color: #007700">=</span><span style="color: #0000BB">600</span><span style="color: #007700">; </span><span style="color: #0000BB">$height</span><span style="color: #007700">=</span><span style="color: #0000BB">400</span><span style="color: #007700">;
<br /></span><span style="color: #0000BB">$graph </span><span style="color: #007700">= new </span><span style="color: #0000BB">Graph</span><span style="color: #007700">(</span><span style="color: #0000BB">$width</span><span style="color: #007700">,</span><span style="color: #0000BB">$height</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-></span><span style="color: #0000BB">img</span><span style="color: #007700">-></span><span style="color: #0000BB">SetMargin</span><span style="color: #007700">(</span><span style="color: #0000BB">$leftm</span><span style="color: #007700">,</span><span style="color: #0000BB">$rightm</span><span style="color: #007700">,</span><span style="color: #0000BB">$topm</span><span style="color: #007700">,</span><span style="color: #0000BB">$bottomm</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-></span><span style="color: #0000BB">SetAngle</span><span style="color: #007700">(</span><span style="color: #0000BB">20</span><span style="color: #007700">);
<br />
<br /></span><span style="color: #FF8000">// Rotate graph around the plots (0,0) point, i.e
<br />// where the graph axis intersect.
<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-></span><span style="color: #0000BB">img</span><span style="color: #007700">-></span><span style="color: #0000BB">SetCenter</span><span style="color: #007700">(</span><span style="color: #0000BB">$leftm</span><span style="color: #007700">,</span><span style="color: #0000BB">$height</span><span style="color: #007700">-(</span><span style="color: #0000BB">$topm</span><span style="color: #007700">+</span><span style="color: #0000BB">$bottomm</span><span style="color: #007700">));
<br /></span><span style="color: #0000BB"></span>
|
||
|
</span>
|
||
|
</b></div><br>
|
||
|
<p>
|
||
|
<p> <div style='font-family: helvetica, arial, geneva, sans-serif;margin-bottom:4px;border-left:solid black 1px;border-top:solid black 1px;border-bottom:solid black 2px;border-right:solid black 2px;font-size:120%;background:#dde9af;padding:4px;'><a class="no" name="_ROTIMAGE_SETMARGIN"><span style="color:#555555;">RotImage ::</span><br><b>SetMargin</b>($lm, $rm, $tm, $bm)</a></div>
|
||
|
|
||
|
<span style='font-family:arial;font-size:95%;'><i>Specify margin for plot</i></span><p>
|
||
|
|
||
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
||
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$lm</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Left margin</td></tr>
|
||
|
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$rm</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Right margin</td></tr>
|
||
|
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$tm</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Top margin</td></tr>
|
||
|
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$bm</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Bottom margin</td></tr>
|
||
|
</table>
|
||
|
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;">Description:</div>Specify the margin, i.e. the area on the side of the actual plot which is used for titles, labels, legends ans so on.
|
||
|
<br>
|
||
|
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;"><p>Example:</div><div style="padding:5px;border:dashed gray 1px;background-color:#f3f3f3;font-family:courier new;font-size:90%;font-weight:bold;"><b><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$graph</span><span style="color: #007700">-></span><span style="color: #0000BB">img</span><span style="color: #007700">-></span><span style="color: #0000BB">SetMargin</span><span style="color: #007700">(</span><span style="color: #0000BB">30</span><span style="color: #007700">,</span><span style="color: #0000BB">30</span><span style="color: #007700">,</span><span style="color: #0000BB">50</span><span style="color: #007700">,</span><span style="color: #0000BB">20</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB"></span>
|
||
|
</span>
|
||
|
</b></div><br>
|
||
|
<p>
|
||
|
<p> <div style='font-family: helvetica, arial, geneva, sans-serif;margin-bottom:4px;border-left:solid black 1px;border-top:solid black 1px;border-bottom:solid black 2px;border-right:solid black 2px;font-size:120%;background:#dde9af;padding:4px;'><a class="no" name="_ROTIMAGE_SETTRANSLATION"><span style="color:#555555;">RotImage ::</span><br><b>SetTranslation</b>($dx, $dy)</a></div>
|
||
|
|
||
|
<span style='font-family:arial;font-size:95%;'><i>Specify translation (in pixels)</i></span><p>
|
||
|
|
||
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
||
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$dx</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Horizontal translation</td></tr>
|
||
|
|
||
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$dy</span>
|
||
|
</span>
|
||
|
|
||
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:100%;font-weight:bold;'> </td><td>Vertical translation</td></tr>
|
||
|
</table>
|
||
|
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;">Description:</div>The translation is applied after the rotation of the image. <br>
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;">See also:</div><ul><li><a href="RotImage.html#_ROTIMAGE_SETCENTER">RotImage::SetCenter()</a><li><a href="RotImage.html#_ROTIMAGE_SETANGLE">RotImage::SetAngle()</a></ul>
|
||
|
<div style="font-weight:bold;font-family:arial;font-size:90%;"><p>Example:</div><div style="padding:5px;border:dashed gray 1px;background-color:#f3f3f3;font-family:courier new;font-size:90%;font-weight:bold;"><b><span style="color: #000000">
|
||
|
<span style="color: #0000BB">$graph</span><span style="color: #007700">-></span><span style="color: #0000BB">img</span><span style="color: #007700">-></span><span style="color: #0000BB">SetTranslation</span><span style="color: #007700">(</span><span style="color: #0000BB">10</span><span style="color: #007700">,</span><span style="color: #0000BB">10</span><span style="color: #007700">)</span><span style="color: #0000BB"></span>
|
||
|
</span>
|
||
|
</b></div><br>
|
||
|
<p> <hr> <p></html>
|