<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.imagesetbrush.php',
    1 => 'imagesetbrush',
    2 => '線の描画用にブラシイメージを設定する',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD および Image 関数',
  ),
  'prev' => 
  array (
    0 => 'function.imagescale.php',
    1 => 'imagescale',
  ),
  'next' => 
  array (
    0 => 'function.imagesetclip.php',
    1 => 'imagesetclip',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/image/functions/imagesetbrush.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagesetbrush" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagesetbrush</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagesetbrush</span> &mdash; <span class="dc-title">線の描画用にブラシイメージを設定する</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagesetbrush-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagesetbrush</strong></span>(<span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>, <span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$brush</code></span>): <span class="type"><a href="language.types.singleton.php" class="type true">true</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imagesetbrush()</strong></span> は、特別な色
   <strong><code><a href="image.constants.php#constant.img-color-brushed">IMG_COLOR_BRUSHED</a></code></strong> または
   <strong><code><a href="image.constants.php#constant.img-color-styledbrushed">IMG_COLOR_STYLEDBRUSHED</a></code></strong> で描画される際に
   (<span class="function"><a href="function.imageline.php" class="function">imageline()</a></span> や
   <span class="function"><a href="function.imagepolygon.php" class="function">imagepolygon()</a></span> のような)
   全ての線描画関数で使用されるブラシイメージを設定します。
  </p>
  <div class="caution"><strong class="caution">警告</strong>
   <p class="para">
    ブラシの使用が終った際には特別な処理は不要ですが、
    ブラシイメージを破棄する(もしくは、PHPに破棄させる)場合には、新たにブラシイメージを設定するまでは、
    色 <strong><code><a href="image.constants.php#constant.img-color-brushed">IMG_COLOR_BRUSHED</a></code></strong> または
    <strong><code><a href="image.constants.php#constant.img-color-styledbrushed">IMG_COLOR_STYLEDBRUSHED</a></code></strong>
    を使用するべきではありません。
   </p>
  </div>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagesetbrush-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    <dt><code class="parameter">image</code></dt><dd><p class="para"><span class="function"><a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a></span>のような画像作成関数が返す <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> オブジェクト。</p></dd>
    
     <dt><code class="parameter">brush</code></dt>
     <dd>
      <p class="para">
       画像オブジェクト。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagesetbrush-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   常に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagesetbrush-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">image</code> と
       <code class="parameter">brush</code> は、
       <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span>
       クラスのインスタンスを期待するようになりました。
       これより前のバージョンでは
       <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> を期待していました。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagesetbrush-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 <span class="function"><strong>imagesetbrush()</strong></span> の例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// 小さい php ロゴを読み込みます<br /></span><span style="color: #0000BB">$php </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatefrompng</span><span style="color: #007700">(</span><span style="color: #DD0000">'./php.png'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 100x100 のメイン画像を作成します<br /></span><span style="color: #0000BB">$im </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatetruecolor</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 背景を白で塗りつぶします<br /></span><span style="color: #0000BB">$white </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagefilledrectangle</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</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">, </span><span style="color: #0000BB">299</span><span style="color: #007700">, </span><span style="color: #0000BB">99</span><span style="color: #007700">, </span><span style="color: #0000BB">$white</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// ブラシを設定します<br /></span><span style="color: #0000BB">imagesetbrush</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">$php</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// いくつかのブラシを重ねます<br /></span><span style="color: #0000BB">imageline</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">50</span><span style="color: #007700">, </span><span style="color: #0000BB">50</span><span style="color: #007700">, </span><span style="color: #0000BB">50</span><span style="color: #007700">, </span><span style="color: #0000BB">60</span><span style="color: #007700">, </span><span style="color: #0000BB">IMG_COLOR_BRUSHED</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 画像をブラウザに出力します<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 /><br /></span><span style="color: #0000BB">imagepng</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>上の例の出力は、
たとえば以下のようになります。</p></div>
    <div class="mediaobject">
     
     <div class="imageobject">
      <img src="images/21009b70229598c6a80eef8b45bf282b-imagesetbrush.png" alt="出力例 : imagesetbrush()" width="100" height="100" />
     </div>
    </div>
   </div>
  </p>
 </div>


</div><?php manual_footer($setup); ?>