function.imagick-chopimage.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 157 行
HTML
157 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Removes a region of an image and trims</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imagick-charcoalimage.html">Imagick::charcoalImage</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imagick-clear.html">Imagick::clear</a></div> <div class="up"><a href="class.imagick.html">The Imagick class</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.imagick-chopimage" class="refentry"> <div class="refnamediv"> <h1 class="refname">Imagick::chopImage</h1> <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">Imagick::chopImage</span> — <span class="dc-title">Removes a region of an image and trims</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><b><b>Imagick::chopImage</b></b></span> ( <span class="methodparam"><span class="type">int</span> <tt class="parameter">$width</tt></span> , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$height</tt></span> , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$x</tt></span> , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$y</tt></span> )</div> <div class="warning"><b class="warning">Warning</b><p class="simpara">This function iscurrently not documented; only its argument list is available.</p></div> <p class="para"> Removes a region of an image and collapses the image to occupy the removed portion. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">width</tt></i></span> <dd> <p class="para"> Width of the chopped area </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">height</tt></i></span> <dd> <p class="para"> Height of the chopped area </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">x</tt></i></span> <dd> <p class="para"> X origo of the chopped area </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">y</tt></i></span> <dd> <p class="para"> Y origo of the chopped area </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <b><tt>TRUE</tt></b> on success. </p> </div> <div class="refsect1 errors"> <h3 class="title">Errors/Exceptions</h3> <p class="para"> Throws ImagickException on error. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 Using <b>Imagick::chopImage()</b>:</b></p> <div class="example-contents"><p> Example of using Imagick::chopImage </p></div> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">/* Create some objects */<br /></span><span style="color: #0000BB">$image </span><span style="color: #007700">= new </span><span style="color: #0000BB">Imagick</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$pixel </span><span style="color: #007700">= new </span><span style="color: #0000BB">ImagickPixel</span><span style="color: #007700">( </span><span style="color: #DD0000">'gray' </span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* New image */<br /></span><span style="color: #0000BB">$image</span><span style="color: #007700">-></span><span style="color: #0000BB">newImage</span><span style="color: #007700">(</span><span style="color: #0000BB">400</span><span style="color: #007700">, </span><span style="color: #0000BB">200</span><span style="color: #007700">, </span><span style="color: #0000BB">$pixel</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Chop image */<br /></span><span style="color: #0000BB">$image</span><span style="color: #007700">-></span><span style="color: #0000BB">chopImage</span><span style="color: #007700">(</span><span style="color: #0000BB">200</span><span style="color: #007700">, </span><span style="color: #0000BB">200</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Give image a format */<br /></span><span style="color: #0000BB">$image</span><span style="color: #007700">-></span><span style="color: #0000BB">setImageFormat</span><span style="color: #007700">(</span><span style="color: #DD0000">'png'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Output the image with headers */<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: image/png'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$image</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?></span></span></code></div> </div> </div> </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.imagick-cropimage.html" class="function" rel="rdfs-seeAlso">Imagick::cropImage()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imagick-charcoalimage.html">Imagick::charcoalImage</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imagick-clear.html">Imagick::clear</a></div> <div class="up"><a href="class.imagick.html">The Imagick class</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?