File: images.xml

package info (click to toggle)
phpdoc 20020310-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 35,272 kB
  • ctags: 354
  • sloc: xml: 799,767; php: 1,395; cpp: 500; makefile: 200; sh: 140; awk: 51
file content (63 lines) | stat: -rw-r--r-- 2,309 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.7 $ -->
 <chapter id="features.images">
  <title>イメージの作成および操作</title>

  <simpara>
   PHP の用途は、HTML 出力のみを作成するだけではありません。PHPにより
   gif, png, jpg, wbmp, xpm といった様々なイメージフォーマットでイメー
   ジファイルを作成したり操作したりすることも可能です。更に便利なこと
   にPHPはイメージストリームを直接ブラウザに出力することも可能です。こ
   の機能を動作させるには、イメージ関数のGDライブラリとともにPHPをコン
   パイルする必要があります。GDとPHPは使用するイメージフォーマットによ
   り他のライブラリも必要とします。
  </simpara>

  <para>
   <example>
    <title>PHPによるPNGの作成</title>
    <programlisting role="php">
<![CDATA[
<?php
    Header("Content-type: image/png");
    $string=implode($argv," ");
    $im = imageCreateFromPng("images/button1.png");
    $orange = ImageColorAllocate($im, 220, 210, 60);
    $px = (imagesx($im)-7.5*strlen($string))/2;
    ImageString($im,3,$px,9,$string,$orange);
    ImagePng($im);
    ImageDestroy($im);
?>
]]>
    </programlisting>
   </example>

   この例は、次のようなタグのあるページからコールされます。
    &lt;img src=&quot;button.php?text&quot;&gt;
    上の button.php スクリプトは文字列 &quot;text&quot; を引数とし、
    その文字列をここではベースイメージ &quot;images/button1.png&quot; の上に
    重ね描きし、結果のイメージを出力します。
    この手法は非常に便利で、ボタンのテキストを変更する度に
    新しいイメージボタンを描く必要がなくなります。
    この手法では、イメージは動的に生成されます。
  </para>

 </chapter>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->