function.imagecopyresampled.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 308 行 · 第 1/2 页

HTML
308
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Copy and resize part of an image with resampling</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.imagecopymergegray.html">imagecopymergegray</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imagecopyresized.html">imagecopyresized</a></div> <div class="up"><a href="ref.image.html">GD Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.imagecopyresampled" class="refentry"> <div class="refnamediv">  <h1 class="refname">imagecopyresampled</h1>  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5)</p><p class="refpurpose"><span class="refname">imagecopyresampled</span> &mdash; <span class="dc-title">Copy and resize part of an image with resampling</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>imagecopyresampled</b></b></span>    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$dst_image</tt></span>   , <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$src_image</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$dst_x</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$dst_y</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$src_x</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$src_y</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$dst_w</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$dst_h</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$src_w</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$src_h</tt></span>   )</div>  <p class="para rdfs-comment">   <b>imagecopyresampled()</b> copies a rectangular   portion of one image to another image, smoothly interpolating pixel   values so that, in particular, reducing the size of an image still   retains a great deal of clarity.  </p>  <p class="para">   In other words, <b>imagecopyresampled()</b> will take an    rectangular area from <i><tt class="parameter">src_image</tt></i> of width    <i><tt class="parameter">src_w</tt></i> and height <i><tt class="parameter">src_h</tt></i> at    position (<i><tt class="parameter">src_x</tt></i>,<i><tt class="parameter">src_y</tt></i>)    and place it in a rectangular area of <i><tt class="parameter">dst_image</tt></i>    of width <i><tt class="parameter">dst_w</tt></i> and height <i><tt class="parameter">dst_h</tt></i>   at position (<i><tt class="parameter">dst_x</tt></i>,<i><tt class="parameter">dst_y</tt></i>).  </p>  <p class="para">   If the source and destination coordinates and width and heights   differ, appropriate stretching or shrinking of the image fragment   will be performed. The coordinates refer to the upper left   corner.  This function can be used to copy regions within the   same image (if <i><tt class="parameter">dst_image</tt></i> is the same as   <i><tt class="parameter">src_image</tt></i>) but if the regions overlap the   results will be unpredictable.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">dst_im</tt></i></span>     <dd>      <p class="para">       Destination image link resource.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">src_im</tt></i></span>     <dd>      <p class="para">       Source image link resource.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">dst_x</tt></i></span>     <dd>      <p class="para">       x-coordinate of destination point.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">dst_y</tt></i></span>     <dd>      <p class="para">       y-coordinate of destination point.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">src_x</tt></i></span>     <dd>      <p class="para">       x-coordinate of source point.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">src_y</tt></i></span>     <dd>      <p class="para">

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?