Location: PHPKode > projects > Moc10 PHP Library > docs/api-docs/Moc10_Image/Moc10_Image.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html>
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Moc10_Image</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Moc10_Image</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
							<a href="#sec-descendents">Descendents</a>
			|											<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Moc10_Image</p>
	<ul class="tags">
				<li><span class="field">author:</span> Nick Sagona, III &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</li>
				<li><span class="field">version:</span> 1.9.7</li>
				<li><span class="field">copyright:</span> Copyright (c) 2009-2011 Moc 10 Media, LLC. (http://www.moc10media.com)</li>
				<li><span class="field">license:</span> <a href="http://www.moc10phplibrary.com/LICENSE.TXT">New BSD License</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Image.php.html">/Image.php</a> (line <span class="field">33</span>)
		</p>
		
				
		<pre><a href="../Moc10_File/Moc10_File.html">Moc10_File</a>
   |
   --Moc10_Image</pre>
	
			</div>
</div>

	<a name="sec-descendents"></a>
	<div class="info-box">
		<div class="info-box-title">Direct descendents</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
			<span class="disabled">Descendents</span>
			|												<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
								|															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<table cellpadding="2" cellspacing="0" class="class-table">
				<tr>
					<th class="class-table-header">Class</th>
					<th class="class-table-header">Description</th>
				</tr>
								<tr>
					<td style="padding-right: 2em"><a href="../Moc10_Image/Moc10_Image_Upload.html">Moc10_Image_Upload</a></td>
					<td>
											Moc10_Image_Upload
										</td>
				</tr>
							</table>
		</div>
	</div>


	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																																<div class="var-title">
					<span class="var-type">int|string</span>
					<a href="#$channels" title="details" class="var-name">$channels</a>
				</div>
																<div class="var-title">
					<span class="var-type">int|string</span>
					<a href="#$height" title="details" class="var-name">$height</a>
				</div>
																<div class="var-title">
					<span class="var-type">int|string</span>
					<a href="#$width" title="details" class="var-name">$width</a>
				</div>
																<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$_allowed" title="details" class="var-name">$_allowed</a>
				</div>
																<div class="var-title">
					<span class="var-type"><a href="../Moc10_Language/Moc10_Language.html">Moc10_Language</a></span>
					<a href="#$_lang" title="details" class="var-name">$_lang</a>
				</div>
																<div class="var-title">
					<span class="var-type">int|string</span>
					<a href="#$_quality" title="details" class="var-name">$_quality</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$img</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$up</span> = <span class="var-default">false</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$typ</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$w</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$h</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$r</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$g</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$b</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#colorTotal" title="details" class="method-name">colorTotal</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#convert" title="details" class="method-name">convert</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#crop" title="details" class="method-name">crop</a>
											(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$px</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$x</span> = <span class="var-default">0</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$y</span> = <span class="var-default">0</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$to</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getColors" title="details" class="method-name">getColors</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$format</span> = <span class="var-default">'HEX'</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#resize" title="details" class="method-name">resize</a>
											(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$px</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$to</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#scale" title="details" class="method-name">scale</a>
											(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$scl</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$to</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#text" title="details" class="method-name">text</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, <span class="var-type">int|string</span>&nbsp;<span class="var-name">$size</span>, <span class="var-type">int|string</span>&nbsp;<span class="var-name">$x</span>, <span class="var-type">int|string</span>&nbsp;<span class="var-name">$y</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$rotate</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$font</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$r</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$g</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$b</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$to</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_createImage" title="details" class="method-name">_createImage</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$new</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$img</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">image</span>
										<a href="#_createNew" title="details" class="method-name">_createNew</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_save" title="details" class="method-name">_save</a>
											(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$w</span>, <span class="var-type">int|string</span>&nbsp;<span class="var-name">$h</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_setQuality" title="details" class="method-name">_setQuality</a>
											(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span>)
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$channels" id="$channels"><!-- --></a>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">int|string</span>
			<span class="var-name">$channels</span>
						(line <span class="line-number">52</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Image channels</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$height" id="$height"><!-- --></a>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">int|string</span>
			<span class="var-name">$height</span>
						(line <span class="line-number">46</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Image height</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$width" id="$width"><!-- --></a>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">int|string</span>
			<span class="var-name">$width</span>
						(line <span class="line-number">40</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Image width</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$_allowed" id="$_allowed"><!-- --></a>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$_allowed</span>
			 = <span class="var-default">array('gif'  =&gt; 'image/gif',<br />                                'jpe'  =&gt; 'image/jpeg',<br />                                'jpg'  =&gt; 'image/jpeg',<br />                                'jpeg' =&gt; 'image/jpeg',<br />                                'png'  =&gt; 'image/png')</span>			(line <span class="line-number">64</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Array of allowed file types.</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
			<hr class="separator" />
		<div class="notes">Redefinition of:</div>
		<dl>
			<dt><a href="../Moc10_File/Moc10_File.html#var$_allowed">Moc10_File::$_allowed</a></dt>
						<dd>Array of allowed file types.</dd>
					</dl>
		
		

</div>
<a name="var$_lang" id="$_lang"><!-- --></a>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type"><a href="../Moc10_Language/Moc10_Language.html">Moc10_Language</a></span>
			<span class="var-name">$_lang</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">74</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Language object</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
			<hr class="separator" />
		<div class="notes">Redefinition of:</div>
		<dl>
			<dt><a href="../Moc10_File/Moc10_File.html#var$_lang">Moc10_File::$_lang</a></dt>
						<dd>Language object</dd>
					</dl>
		
		

</div>
<a name="var$_quality" id="$_quality"><!-- --></a>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">int|string</span>
			<span class="var-name">$_quality</span>
						(line <span class="line-number">58</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Image quality</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
							<h4>Inherited Variables</h4>
				<a name='inherited_vars'><!-- --></a>
									<p>Inherited from <span class="classname"><a href="../Moc10_File/Moc10_File.html">Moc10_File</a></span></p>
					<blockquote>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$basename">Moc10_File::$basename</a></span><br />
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$dir">Moc10_File::$dir</a></span><br />
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$ext">Moc10_File::$ext</a></span><br />
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$filename">Moc10_File::$filename</a></span><br />
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$fullpath">Moc10_File::$fullpath</a></span><br />
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$mime">Moc10_File::$mime</a></span><br />
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$size">Moc10_File::$size</a></span><br />
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$_output">Moc10_File::$_output</a></span><br />
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../Moc10_File/Moc10_File.html#var$_perm">Moc10_File::$_perm</a></span><br />
							</span>
											</blockquote> 
										
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<a name='method_detail'></a>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">92</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<p class="description">Instantiate an image file object based on either a pre-existing image file on disk, or a new image file.</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$img</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$up</span> = <span class="var-default">false</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$typ</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$w</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$h</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$r</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$g</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$b</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$img</span>			</li>
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$up</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$typ</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$w</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$h</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$r</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$g</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$b</span>			</li>
				</ul>
		
			<hr class="separator" />
		<div class="notes">Redefinition of:</div>
		<dl>
			<dt><a href="../Moc10_File/Moc10_File.html#method__construct">Moc10_File::__construct()</a></dt>
						<dd>Constructor</dd>
					</dl>
			
			<hr class="separator" />
		<div class="notes">Redefined in descendants as:</div>
		<ul class="redefinitions">
					<li>
				<a href="../Moc10_Image/Moc10_Image_Upload.html#method__construct">Moc10_Image_Upload::__construct()</a>
								: Constructor
							</li>
				</ul>
	</div>
<a name="methodcolorTotal" id="colorTotal"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">colorTotal</span> (line <span class="line-number">503</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return the number of colors in the palette of indexed images. Returns 0 for true color images.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			colorTotal
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodconvert" id="convert"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">convert</span> (line <span class="line-number">416</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Convert the image object to the new specified image type.</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			convert
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$type</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$q</span>			</li>
				</ul>
		
			
	</div>
<a name="methodcrop" id="crop"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">crop</span> (line <span class="line-number">271</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Crop the image object to a square image whose dimensions are based on the value of the $px argument.</p>
<p class="description">The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped.  For example, if the values of $px = 50, $x = 20, $y = 0 are passed, then a 50px X 50px image will be created from the  original image, with its origins starting at the (20, 0) x-y coordinates. The $q argument is an optional argument for  the quality of the image that must range between 0 (lowest) and 100 (highest.) The $to argument is an optional argument  to save the altered image to another image file without overwriting the original.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			crop
		</span>
					(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$px</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$x</span> = <span class="var-default">0</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$y</span> = <span class="var-default">0</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$to</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$px</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$x</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$y</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$q</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$to</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetColors" id="getColors"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getColors</span> (line <span class="line-number">526</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return all of the colors in the palette in an array format, omitting any repeats. It is strongly advised that this method only be used  for smaller image files, preferably with small palettes, as any large images with many colors will cause this method to run slowly.</p>
<p class="description">Default format of the values in the returned array is the 6-digit HEX value, but if 'RGB' is passed, then the format of the values  in the returned array will be 'R,G,B', i.e. '235,123,12'.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getColors
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$format</span> = <span class="var-default">'HEX'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$format</span>			</li>
				</ul>
		
			
	</div>
<a name="methodresize" id="resize"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">resize</span> (line <span class="line-number">164</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Resize the image object, allowing for the largest dimension to be scaled to the value of the $px argument.</p>
<p class="description">For example, if the value of $px = 200, and the image is 800px X 600px, then the image will be scaled to 200px X 150px.  The $q argument is an optional argument for the quality of the image that must range between 0 (lowest) and 100 (highest.)  The $to argument is an optional argument to save the altered image to another image file without overwriting the original.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			resize
		</span>
					(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$px</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$to</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$px</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$q</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$to</span>			</li>
				</ul>
		
			
	</div>
<a name="methodscale" id="scale"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">scale</span> (line <span class="line-number">217</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Scale the image object, allowing for the dimensions to be scaled proportionally to the value of the $scl argument.</p>
<p class="description">For example, if the value of $scl = 0.50, and the image is 800px X 600px, then the image will be scaled to 400px X 300px.  The $q argument is an optional argument for the quality of the image that must range between 0 (lowest) and 100 (highest.)  The $to argument is an optional argument to save the altered image to another image file without overwriting the original.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			scale
		</span>
					(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$scl</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$to</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$scl</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$q</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$to</span>			</li>
				</ul>
		
			
	</div>
<a name="methodtext" id="text"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">text</span> (line <span class="line-number">354</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Create text within the an image object and output it. A true-type font file is required for the font argument. The size,</p>
<p class="description">rotation and position can be set by those respective arguments. The RGB color of the text can be set by the respective  optional arguments. This is a useful method for creating CAPTCHA images or rendering sensitive information to the user  that cannot or should not be rendered by HTML (i.e. email addresses.) The $to argument is an optional argument to save  the altered image to another image file without overwriting the original.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			text
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, <span class="var-type">int|string</span>&nbsp;<span class="var-name">$size</span>, <span class="var-type">int|string</span>&nbsp;<span class="var-name">$x</span>, <span class="var-type">int|string</span>&nbsp;<span class="var-name">$y</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$rotate</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$font</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$r</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$g</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$b</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$to</span> = <span class="var-default">null</span>], [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$str</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$size</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$x</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$y</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$rotate</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$font</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$r</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$g</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$b</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$to</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$q</span>			</li>
				</ul>
		
			
	</div>
<a name="method_createImage" id="_createImage"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_createImage</span> (line <span class="line-number">616</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Create and save the new image file in the correct format.</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_createImage
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$new</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$img</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$new</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$img</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$q</span>			</li>
				</ul>
		
			
	</div>
<a name="method_createNew" id="_createNew"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_createNew</span> (line <span class="line-number">590</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Create a blank image based on the current image type of the image object.</p>
	<ul class="tags">
				<li><span class="field">return:</span> resource</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">image</span>
		<span class="method-name">
			_createNew
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method_save" id="_save"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_save</span> (line <span class="line-number">641</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Save the image object using with any newly defined properties.</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_save
		</span>
					(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$w</span>, <span class="var-type">int|string</span>&nbsp;<span class="var-name">$h</span>, [<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$w</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$h</span>			</li>
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$q</span>			</li>
				</ul>
		
			
	</div>
<a name="method_setQuality" id="_setQuality"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_setQuality</span> (line <span class="line-number">572</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set the image quality based on the type of image.</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_setQuality
		</span>
					(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$q</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$q</span>			</li>
				</ul>
		
			
	</div>
							<h4>Inherited Methods</h4>
				<a name='inherited_methods'><!-- --></a>	
									<!-- =========== Summary =========== -->
					<p>Inherited From <span class="classname"><a href="../Moc10_File/Moc10_File.html">Moc10_File</a></span></p>
					<blockquote>
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#method__construct">Moc10_File::__construct()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodcopy">Moc10_File::copy()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methoddelete">Moc10_File::delete()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodexport">Moc10_File::export()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodgetAllowedTypes">Moc10_File::getAllowedTypes()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodgetMode">Moc10_File::getMode()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodimport">Moc10_File::import()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodmove">Moc10_File::move()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodoutput">Moc10_File::output()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodread">Moc10_File::read()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodsetFile">Moc10_File::setFile()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodsetMode">Moc10_File::setMode()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#methodwrite">Moc10_File::write()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#method_checkPermissions">Moc10_File::_checkPermissions()</a></span><br />
													<span class="method-name"><a href="../Moc10_File/Moc10_File.html#method_setAllowedTypes">Moc10_File::_setAllowedTypes()</a></span><br />
											</blockquote>
										
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Wed, 12 Jan 2011 01:17:43 -0600 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>
Return current item: Moc10 PHP Library