cvs: phpdoc-zh /reference/image/functions imagecopymerge.xml imagecopyresampled.xml imagecopyresized.xml imagedestroy.xml imageloadfont.xml
imagesetpixel.xml imagewbmp.xml
| From: | Dallas Thunder | Date: | Sun, 04 Sep 2005 07:34:51 +0000 |
| Subject: | cvs: phpdoc-zh /reference/image/functions imagecopymerge.xml imagecopyresampled.xml imagecopyresized.xml imagedestroy.xml imageloadfont.xml imagesetpixel.xml imagewbmp.xml |
||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2589@lists.php.net to get a copy of this message | ||
dallas Sun Sep 4 03:34:51 2005 EDT
Modified files:
/phpdoc-zh/reference/image/functions imagecopymerge.xml
imagecopyresampled.xml
imagecopyresized.xml
imagedestroy.xml
imageloadfont.xml
imagesetpixel.xml
imagewbmp.xml
Log:
Updated.
http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagecopymerge.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/image/functions/imagecopymerge.xml diff -u phpdoc-zh/reference/image/functions/imagecopymerge.xml:1.1 phpdoc-zh/reference/image/functions/imagecopymerge.xml:1.2 --- phpdoc-zh/reference/image/functions/imagecopymerge.xml:1.1 Thu Aug 28 00:08:14 2003 +++ phpdoc-zh/reference/image/functions/imagecopymerge.xml Sun Sep 4 03:34:48 2005 @@ -1,44 +1,45 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> - <refentry id="function.imagecopymerge"> - <refnamediv> - <refname>imagecopymerge</refname> - <refpurpose>¿½±´²¢ºÏ²¢Í¼ÏñµÄÒ»²¿·Ö</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>imagecopymerge</methodname> - <methodparam><type>resource</type><parameter>dst_im</parameter></methodparam> - <methodparam><type>resource</type><parameter>src_im</parameter></methodparam> - <methodparam><type>int</type><parameter>dst_x</parameter></methodparam> - <methodparam><type>int</type><parameter>dst_y</parameter></methodparam> - <methodparam><type>int</type><parameter>src_x</parameter></methodparam> - <methodparam><type>int</type><parameter>src_y</parameter></methodparam> - <methodparam><type>int</type><parameter>src_w</parameter></methodparam> - <methodparam><type>int</type><parameter>src_h</parameter></methodparam> - <methodparam><type>int</type><parameter>pct</parameter></methodparam> - </methodsynopsis> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<refentry id="function.imagecopymerge"> + <refnamediv> + <refname>imagecopymerge</refname> + <refpurpose>¿½±´²¢ºÏ²¢Í¼ÏñµÄÒ»²¿·Ö</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagecopymerge</methodname> + <methodparam><type>resource</type><parameter>dst_im</parameter></methodparam> + <methodparam><type>resource</type><parameter>src_im</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_x</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_y</parameter></methodparam> + <methodparam><type>int</type><parameter>src_x</parameter></methodparam> + <methodparam><type>int</type><parameter>src_y</parameter></methodparam> + <methodparam><type>int</type><parameter>src_w</parameter></methodparam> + <methodparam><type>int</type><parameter>src_h</parameter></methodparam> + <methodparam><type>int</type><parameter>pct</parameter></methodparam> + </methodsynopsis> + <para> + ½« <parameter>src_im</parameter> ͼÏñÖÐ×ø±ê´Ó + <parameter>src_x</parameter>£¬<parameter>src_y </parameter> + ¿ªÊ¼£¬¿í¶ÈΪ <parameter>src_w</parameter>£¬¸ß¶ÈΪ <parameter>src_h</parameter> + µÄÒ»²¿·Ö¿½±´µ½ + <parameter>dst_im</parameter> ͼÏñÖÐ×ø±êΪ + <parameter>dst_x</parameter> ºÍ <parameter>dst_y</parameter> + µÄλÖÃÉÏ¡£Á½Í¼Ïñ½«¸ù¾Ý <parameter>pct</parameter> + À´¾ö¶¨ºÏ²¢³Ì¶È£¬ÆäÖµ·¶Î§´Ó 0 µ½ 100¡£µ± <parameter>pct</parameter> = 0 + ʱ£¬Êµ¼ÊÉÏʲôҲû×ö£¬µ±Îª 100 ʱ¶ÔÓÚµ÷É«°åͼÏñ±¾º¯ÊýºÍ + <function>imagecopy</function> ÍêȫһÑù£¬Ëü¶ÔÕæ²ÊɫͼÏñʵÏÖÁË alpha ͸Ã÷¡£ + </para> + <note> <para> - ½« <parameter>src_im</parameter> ͼÏñÖÐ×ø±ê´Ó - <parameter>src_x</parameter>£¬<parameter>src_y </parameter> - ¿ªÊ¼£¬¿í¶ÈΪ <parameter>src_w</parameter>£¬¸ß¶ÈΪ <parameter>src_h</parameter> - µÄÒ»²¿·Ö¿½±´µ½ - <parameter>dst_im</parameter> ͼÏñÖÐ×ø±êΪ - <parameter>dst_x</parameter> ºÍ <parameter>dst_y</parameter> - µÄλÖÃÉÏ¡£Á½Í¼Ïñ½«¸ù¾Ý <parameter>pct</parameter> - À´¾ö¶¨ºÏ²¢³Ì¶È£¬ÆäÖµ·¶Î§´Ó 0 µ½ 100¡£µ± <parameter>pct</parameter> = 0 - ʱ£¬Êµ¼ÊÉÏʲôҲû×ö£¬µ±Îª 100 ʱ±¾º¯ÊýºÍ <function>imagecopy</function> ÍêȫһÑù¡£ + ±¾º¯ÊýÊÇ PHP 4.0.6 мӵġ£ </para> - <note> - <para> - ÕâÊÇ PHP 4.0.6 мӵġ£ - </para> - </note> - </refsect1> - </refentry> + </note> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagecopyresampled.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/image/functions/imagecopyresampled.xml diff -u phpdoc-zh/reference/image/functions/imagecopyresampled.xml:1.1 phpdoc-zh/reference/image/functions/imagecopyresampled.xml:1.2 --- phpdoc-zh/reference/image/functions/imagecopyresampled.xml:1.1 Thu Aug 28 00:08:14 2003 +++ phpdoc-zh/reference/image/functions/imagecopyresampled.xml Sun Sep 4 03:34:49 2005 @@ -1,52 +1,135 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> - <refentry id="function.imagecopyresampled"> - <refnamediv> - <refname>imagecopyresampled</refname> - <refpurpose>ÖØ²ÉÑù¿½±´²¿·ÖͼÏñ²¢µ÷Õû´óС</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>imagecopyresampled</methodname> - <methodparam><type>resource</type><parameter>dst_im</parameter></methodparam> - <methodparam><type>resource</type><parameter>src_im</parameter></methodparam> - <methodparam><type>int</type><parameter>dstX</parameter></methodparam> - <methodparam><type>int</type><parameter>dstY</parameter></methodparam> - <methodparam><type>int</type><parameter>srcX</parameter></methodparam> - <methodparam><type>int</type><parameter>srcY</parameter></methodparam> - <methodparam><type>int</type><parameter>dstW</parameter></methodparam> - <methodparam><type>int</type><parameter>dstH</parameter></methodparam> - <methodparam><type>int</type><parameter>srcW</parameter></methodparam> - <methodparam><type>int</type><parameter>srcH</parameter></methodparam> - </methodsynopsis> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.imagecopyresampled"> + <refnamediv> + <refname>imagecopyresampled</refname> + <refpurpose>ÖØ²ÉÑù¿½±´²¿·ÖͼÏñ²¢µ÷Õû´óС</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagecopyresampled</methodname> + <methodparam><type>resource</type><parameter>dst_image</parameter></methodparam> + <methodparam><type>resource</type><parameter>src_image</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_x</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_y</parameter></methodparam> + <methodparam><type>int</type><parameter>src_x</parameter></methodparam> + <methodparam><type>int</type><parameter>src_y</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_w</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_h</parameter></methodparam> + <methodparam><type>int</type><parameter>src_w</parameter></methodparam> + <methodparam><type>int</type><parameter>src_h</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagecopyresampled</function> + ½«Ò»·ùͼÏñÖеÄÒ»¿éÕý·½ÐÎÇøÓò¿½±´µ½ÁíÒ»¸öͼÏñÖУ¬Æ½»¬µØ²åÈëÏñËØÖµ£¬Òò´Ë£¬ÓÈÆäÊÇ£¬¼õСÁËͼÏñµÄ´óС¶øÈÔÈ»±£³ÖÁ˼«´óµÄÇåÎú¶È¡£&return.success; + </para> + <para> + <parameter>dst_image</parameter> + ºÍ <parameter>src_image</parameter> + ·Ö±ðÊÇÄ¿±êͼÏñºÍԴͼÏñµÄ±êʶ·û¡£Èç¹ûÔ´ºÍÄ¿±êµÄ¿í¶ÈºÍ¸ß¶È²»Í¬£¬Ôò»á½øÐÐÏàÓ¦µÄͼÏñÊÕËõºÍÀÉì¡£×ø±êÖ¸µÄÊÇ×óÉϽǡ£±¾º¯Êý¿ÉÓÃÀ´ÔÚͬһ·ùͼÄÚ²¿¿½±´£¨Èç¹û + <parameter>dst_image</parameter> ºÍ <parameter>src_image</parameter> + ÏàͬµÄ»°£©ÇøÓò£¬µ«Èç¹ûÇøÓò½»µüµÄ»°Ôò½á¹û²»¿ÉÔ¤Öª¡£ + </para> + <note> <para> - <function>imagecopyresampled</function> - ½«Ò»·ùͼÏñÖеÄÒ»¿éÕý·½ÐÎÇøÓò¿½±´µ½ÁíÒ»¸öͼÏñÖУ¬Æ½»¬µØ²åÈëÏñËØÖµ£¬Òò´Ë£¬ÓÈÆäÊÇ£¬¼õСÁËͼÏñµÄ´óС¶øÈÔÈ»±£³ÖÁ˼«´óµÄÇåÎú¶È¡£<parameter>dst_im</parameter> - ºÍ <parameter>src_im</parameter> - ·Ö±ðÊÇÄ¿±êͼÏñºÍԴͼÏñµÄ±êʶ·û¡£Èç¹ûÔ´ºÍÄ¿±êµÄ¿í¶ÈºÍ¸ß¶È²»Í¬£¬Ôò»á½øÐÐÏàÓ¦µÄͼÏñÊÕËõºÍÀÉì¡£×ø±êÖ¸µÄÊÇ×óÉϽǡ£±¾º¯Êý¿ÉÓÃÀ´ÔÚͬһ·ùͼÄÚ²¿¿½±´£¨Èç¹û - <parameter>dst_im</parameter> ºÍ <parameter>src_im</parameter> - ÏàͬµÄ»°£©ÇøÓò£¬µ«Èç¹ûÇøÓò½»µüµÄ»°Ôò½á¹û²»¿ÉÔ¤Öª¡£ + ÒòΪµ÷É«°åͼÏñÏÞÖÆ£¨255+1 ÖÖÑÕÉ«£©ÓиöÎÊÌâ¡£ÖØ²ÉÑù»ò¹ýÂËͼÏñͨ³£ÐèÒª¶àÓÚ 255 + ÖÖÑÕÉ«£¬¼ÆËãеı»ÖزÉÑùµÄÏñËØ¼°ÆäÑÕɫʱ²ÉÓÃÁËÒ»ÖÖ½üËÆÖµ¡£¶Ôµ÷É«°åͼÏñ³¢ÊÔ·ÖÅäÒ»¸öÐÂÑÕɫʱ£¬Èç¹ûʧ°ÜÎÒÃÇÑ¡ÔñÁ˼ÆËã½á¹û×î½Ó½ü£¨ÀíÂÛÉÏ£©µÄÑÕÉ«¡£Õâ²¢²»×ÜÊÇÊÓ¾õÉÏ×î½Ó½üµÄÑÕÉ«¡£Õâ¿ÉÄÜ»á²úÉú¹ÖÒìµÄ½á¹û£¬ÀýÈç¿Õ°×£¨»òÕßÊÓ¾õÉÏÊǿհף©µÄͼÏñ¡£ÒªÌø¹ýÕâ¸öÎÊÌ⣬ÇëʹÓÃÕæ²ÊɫͼÏñ×÷ΪĿ±êͼÏñ£¬ÀýÈçÓà + <function>imagecreatetruecolor</function> ´´½¨µÄ¡£ </para> - <note> - <para> - ÒòΪµ÷É«°åͼÏñÏÞÖÆ£¨255+1 ÖÖÑÕÉ«£©ÓиöÎÊÌâ¡£ÖØ²ÉÑù»ò¹ýÂËͼÏñͨ³£ÐèÒª¶àÓÚ 255 - ÖÖÑÕÉ«£¬¼ÆËãеı»ÖزÉÑùµÄÏñËØ¼°ÆäÑÕɫʱ²ÉÓÃÁËÒ»ÖÖ½üËÆÖµ¡£¶Ôµ÷É«°åͼÏñ³¢ÊÔ·ÖÅäÒ»¸öÐÂÑÕɫʱ£¬Èç¹ûʧ°ÜÎÒÃÇÑ¡ÔñÁ˼ÆËã½á¹û×î½Ó½ü£¨ÀíÂÛÉÏ£©µÄÑÕÉ«¡£Õâ²¢²»×ÜÊÇÊÓ¾õÉÏ×î½Ó½üµÄÑÕÉ«¡£Õâ¿ÉÄÜ»á²úÉú¹ÖÒìµÄ½á¹û£¬ÀýÈç¿Õ°×£¨»òÕßÊÓ¾õÉÏÊǿհף©µÄͼÏñ¡£ÒªÌø¹ýÕâ¸öÎÊÌ⣬ÇëʹÓÃÕæ²ÊɫͼÏñ×÷ΪĿ±êͼÏñ£¬ÀýÈçÓà - <function>imagecreatetruecolor</function> ´´½¨µÄ¡£ - </para> - </note> - <note> + </note> + ¬e.gd.2; + </refsect1> + + <refsect1> + + &reftitle.examples; + + <para> + <example> + <title>¼òµ¥Àý×Ó</title> <para> - <function>imagecopyresampled</function> ÐèÒª GD 2.0.l »ò¸ü¸ß°æ±¾¡£ + ±¾ÀýÖн«°ÑÒ»·ùͼÏñÖØ²ÉÑùΪÔʼ´óСµÄÒ»°ë¡£ </para> - </note> + <programlisting role="php"> +<![CDATA[ +<?php +// The file +$filename = 'test.jpg'; +$percent = 0.5; + +// Content type +header('Content-type: image/jpeg'); + +// Get new dimensions +list($width, $height) = getimagesize($filename); +$new_width = $width * $percent; +$new_height = $height * $percent; + +// Resample +$image_p = imagecreatetruecolor($new_width, $new_height); +$image = imagecreatefromjpeg($filename); +imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); + +// Output +imagejpeg($image_p, null, 100); +?> +]]> + </programlisting> + </example> + </para> + <para> - ²Î¼û <function>imagecopyresized</function>¡£ + <example> + <title>°´±ÈÀýÖØ²ÉÑùͼÏñ</title> + <para> + ±¾Àý½«°ÑÒ»·ùͼÏñ°´×î¿í»ò×î¸ß 200 ÏñËØÀ´ÏÔʾ¡£ + </para> + <programlisting role="php"> +<![CDATA[ +<?php +// The file +$filename = 'test.jpg'; + +// Set a maximum height and width +$width = 200; +$height = 200; + +// Content type +header('Content-type: image/jpeg'); + +// Get new dimensions +list($width_orig, $height_orig) = getimagesize($filename); + +if ($width && ($width_orig < $height_orig)) { + $width = ($height / $height_orig) * $width_orig; +} else { + $height = ($width / $width_orig) * $height_orig; +} + +// Resample +$image_p = imagecreatetruecolor($width, $height); +$image = imagecreatefromjpeg($filename); +imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); + +// Output +imagejpeg($image_p, null, 100); +?> +]]> + </programlisting> + </example> </para> </refsect1> - </refentry> + + <refsect1> + &reftitle.seealso; + <para> + <function>imagecopyresized</function> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagecopyresized.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/image/functions/imagecopyresized.xml diff -u phpdoc-zh/reference/image/functions/imagecopyresized.xml:1.1 phpdoc-zh/reference/image/functions/imagecopyresized.xml:1.2 --- phpdoc-zh/reference/image/functions/imagecopyresized.xml:1.1 Thu Aug 28 00:08:14 2003 +++ phpdoc-zh/reference/image/functions/imagecopyresized.xml Sun Sep 4 03:34:49 2005 @@ -1,47 +1,94 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> - <refentry id="function.imagecopyresized"> - <refnamediv> - <refname>imagecopyresized</refname> - <refpurpose>¿½±´²¿·ÖͼÏñ²¢µ÷Õû´óС</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>imagecopyresized</methodname> - <methodparam><type>resource</type><parameter>dst_im</parameter></methodparam> - <methodparam><type>resource</type><parameter>src_im</parameter></methodparam> - <methodparam><type>int</type><parameter>dstX</parameter></methodparam> - <methodparam><type>int</type><parameter>dstY</parameter></methodparam> - <methodparam><type>int</type><parameter>srcX</parameter></methodparam> - <methodparam><type>int</type><parameter>srcY</parameter></methodparam> - <methodparam><type>int</type><parameter>dstW</parameter></methodparam> - <methodparam><type>int</type><parameter>dstH</parameter></methodparam> - <methodparam><type>int</type><parameter>srcW</parameter></methodparam> - <methodparam><type>int</type><parameter>srcH</parameter></methodparam> - </methodsynopsis> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.imagecopyresized"> + <refnamediv> + <refname>imagecopyresized</refname> + <refpurpose>¿½±´²¿·ÖͼÏñ²¢µ÷Õû´óС</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagecopyresized</methodname> + <methodparam><type>resource</type><parameter>dst_image</parameter></methodparam> + <methodparam><type>resource</type><parameter>src_image</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_x</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_y</parameter></methodparam> + <methodparam><type>int</type><parameter>src_x</parameter></methodparam> + <methodparam><type>int</type><parameter>src_y</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_w</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_h</parameter></methodparam> + <methodparam><type>int</type><parameter>src_w</parameter></methodparam> + <methodparam><type>int</type><parameter>src_h</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagecopyresized</function> + ½«Ò»·ùͼÏñÖеÄÒ»¿éÕý·½ÐÎÇøÓò¿½±´µ½ÁíÒ»¸öͼÏñÖС£<parameter>dst_image</parameter> + ºÍ <parameter>src_image</parameter> + ·Ö±ðÊÇÄ¿±êͼÏñºÍԴͼÏñµÄ±êʶ·û¡£Èç¹ûÔ´ºÍÄ¿±êµÄ¿í¶ÈºÍ¸ß¶È²»Í¬£¬Ôò»á½øÐÐÏàÓ¦µÄͼÏñÊÕËõºÍÀÉì¡£×ø±êÖ¸µÄÊÇ×óÉϽǡ£±¾º¯Êý¿ÉÓÃÀ´ÔÚͬһ·ùͼÄÚ²¿¿½±´£¨Èç¹û + <parameter>dst_image</parameter> ºÍ <parameter>src_image</parameter> + ÏàͬµÄ»°£©ÇøÓò£¬µ«Èç¹ûÇøÓò½»µüµÄ»°Ôò½á¹û²»¿ÉÔ¤Öª¡£ + </para> + <note> <para> - <function>imagecopyresized</function> - ½«Ò»·ùͼÏñÖеÄÒ»¿éÕý·½ÐÎÇøÓò¿½±´µ½ÁíÒ»¸öͼÏñÖС£<parameter>dst_im</parameter> - ºÍ <parameter>src_im</parameter> - ·Ö±ðÊÇÄ¿±êͼÏñºÍԴͼÏñµÄ±êʶ·û¡£Èç¹ûÔ´ºÍÄ¿±êµÄ¿í¶ÈºÍ¸ß¶È²»Í¬£¬Ôò»á½øÐÐÏàÓ¦µÄͼÏñÊÕËõºÍÀÉì¡£×ø±êÖ¸µÄÊÇ×óÉϽǡ£±¾º¯Êý¿ÉÓÃÀ´ÔÚͬһ·ùͼÄÚ²¿¿½±´£¨Èç¹û - <parameter>dst_im</parameter> ºÍ <parameter>src_im</parameter> - ÏàͬµÄ»°£©ÇøÓò£¬µ«Èç¹ûÇøÓò½»µüµÄ»°Ôò½á¹û²»¿ÉÔ¤Öª¡£ + ÒòΪµ÷É«°åͼÏñÏÞÖÆ£¨255+1 ÖÖÑÕÉ«£©ÓиöÎÊÌâ¡£ÖØ²ÉÑù»ò¹ýÂËͼÏñͨ³£ÐèÒª¶àÓÚ 255 + ÖÖÑÕÉ«£¬¼ÆËãеı»ÖزÉÑùµÄÏñËØ¼°ÆäÑÕɫʱ²ÉÓÃÁËÒ»ÖÖ½üËÆÖµ¡£¶Ôµ÷É«°åͼÏñ³¢ÊÔ·ÖÅäÒ»¸öÐÂÑÕɫʱ£¬Èç¹ûʧ°ÜÎÒÃÇÑ¡ÔñÁ˼ÆËã½á¹û×î½Ó½ü£¨ÀíÂÛÉÏ£©µÄÑÕÉ«¡£Õâ²¢²»×ÜÊÇÊÓ¾õÉÏ×î½Ó½üµÄÑÕÉ«¡£Õâ¿ÉÄÜ»á²úÉú¹ÖÒìµÄ½á¹û£¬ÀýÈç¿Õ°×£¨»òÕßÊÓ¾õÉÏÊǿհף©µÄͼÏñ¡£ÒªÌø¹ýÕâ¸öÎÊÌ⣬ÇëʹÓÃÕæ²ÊɫͼÏñ×÷ΪĿ±êͼÏñ£¬ÀýÈçÓà + <function>imagecreatetruecolor</function> ´´½¨µÄ¡£ </para> - <note> + </note> + </refsect1> + + <refsect1> + &reftitle.examples; + <para> + <example> + <title>µ÷ÕûͼÏñ´óС</title> <para> - ÒòΪµ÷É«°åͼÏñÏÞÖÆ£¨255+1 ÖÖÑÕÉ«£©ÓиöÎÊÌâ¡£ÖØ²ÉÑù»ò¹ýÂËͼÏñͨ³£ÐèÒª¶àÓÚ 255 - ÖÖÑÕÉ«£¬¼ÆËãеı»ÖزÉÑùµÄÏñËØ¼°ÆäÑÕɫʱ²ÉÓÃÁËÒ»ÖÖ½üËÆÖµ¡£¶Ôµ÷É«°åͼÏñ³¢ÊÔ·ÖÅäÒ»¸öÐÂÑÕɫʱ£¬Èç¹ûʧ°ÜÎÒÃÇÑ¡ÔñÁ˼ÆËã½á¹û×î½Ó½ü£¨ÀíÂÛÉÏ£©µÄÑÕÉ«¡£Õâ²¢²»×ÜÊÇÊÓ¾õÉÏ×î½Ó½üµÄÑÕÉ«¡£Õâ¿ÉÄÜ»á²úÉú¹ÖÒìµÄ½á¹û£¬ÀýÈç¿Õ°×£¨»òÕßÊÓ¾õÉÏÊǿհף©µÄͼÏñ¡£ÒªÌø¹ýÕâ¸öÎÊÌ⣬ÇëʹÓÃÕæ²ÊɫͼÏñ×÷ΪĿ±êͼÏñ£¬ÀýÈçÓà - <function>imagecreatetruecolor</function> ´´½¨µÄ¡£ + ±¾Àý½«ÒÔÔÀ´µÄÒ»°ë´óСÏÔʾͼÏñ¡£ </para> - </note> - <para> - ²Î¼û <function>imagecopyresampled</function>¡£ - </para> - </refsect1> - </refentry> + <programlisting role="php"> +<![CDATA[ +<?php +// File and new size +$filename = 'test.jpg'; +$percent = 0.5; + +// Content type +header('Content-type: image/jpeg'); + +// Get new sizes +list($width, $height) = getimagesize($filename); +$newwidth = $width * $percent; +$newheight = $height * $percent; + +// Load +$thumb = imagecreatetruecolor($newwidth, $newheight); +$source = imagecreatefromjpeg($filename); + +// Resize +imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + +// Output +imagejpeg($thumb); +?> +]]> + </programlisting> + <para> + ͼÏñ½«ÒÔÒ»°ë´óСÊä³ö£¬²»¹ý¿ÉÒÔÓà + <function>imagecopyresampled</function> µÃµ½¸üºÃµÄÖÊÁ¿¡£ + </para> + </example> + </para> + </refsect1> + + <refsect1> + &reftitle.seealso; + <para> + <function>imagecopyresampled</function> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagedestroy.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/image/functions/imagedestroy.xml diff -u phpdoc-zh/reference/image/functions/imagedestroy.xml:1.2 phpdoc-zh/reference/image/functions/imagedestroy.xml:1.3 --- phpdoc-zh/reference/image/functions/imagedestroy.xml:1.2 Fri Jul 15 11:37:55 2005 +++ phpdoc-zh/reference/image/functions/imagedestroy.xml Sun Sep 4 03:34:49 2005 @@ -1,25 +1,26 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.imagedestroy"> - <refnamediv> - <refname>imagedestroy</refname> - <refpurpose>Ïú»ÙһͼÏñ</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>imagedestroy</methodname> - <methodparam><type>resource</type><parameter>image</parameter></methodparam> - </methodsynopsis> - <para> - <function>imagedestroy</function> ÊÍ·ÅÓë - <parameter>image</parameter> ¹ØÁªµÄÄÚ´æ¡£<parameter>image</parameter> - ÊÇ <function>imagecreate</function> º¯Êý·µ»ØµÄͼÏñ±êʶ·û¡£ - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<refentry id="function.imagedestroy"> + <refnamediv> + <refname>imagedestroy</refname> + <refpurpose>Ïú»ÙһͼÏñ</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagedestroy</methodname> + <methodparam><type>resource</type><parameter>image</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagedestroy</function> ÊÍ·ÅÓë + <parameter>image</parameter> ¹ØÁªµÄÄÚ´æ¡£<parameter>image</parameter> + ÊÇÓÉͼÏñ´´½¨º¯Êý·µ»ØµÄͼÏñ±êʶ·û£¬ÀýÈç + <function>imagecreatetruecolor</function>¡£ + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imageloadfont.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/image/functions/imageloadfont.xml diff -u phpdoc-zh/reference/image/functions/imageloadfont.xml:1.2 phpdoc-zh/reference/image/functions/imageloadfont.xml:1.3 --- phpdoc-zh/reference/image/functions/imageloadfont.xml:1.2 Fri Jul 15 11:59:12 2005 +++ phpdoc-zh/reference/image/functions/imageloadfont.xml Sun Sep 4 03:34:49 2005 @@ -1,95 +1,93 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> - <refentry id="function.imageloadfont"> - <refnamediv> - <refname>imageloadfont</refname> - <refpurpose>ÔØÈëÒ»ÐÂ×ÖÌå</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>imageloadfont</methodname> - <methodparam><type>string</type><parameter>file</parameter></methodparam> - </methodsynopsis> - <para> - <function>imageloadfont</function> - ¼ÓÔØÒ»¸öÓû§¶¨ÒåµÄλͼ×ÖÌå²¢·µ»Ø¸Ã×ÖÌåµÄ±êʶ·û£¨ÆäÖµ×ÜÊÇ´óÓÚ - 5£¬Òò´Ë²»»áºÍÄÚÖÃ×ÖÌå³åÍ»£©¡£ - ÔÚ²úÉú´íÎóµÄÇé¿öÏ£¬¸Ãº¯Êý·µ»Ø &false; ¡£ - </para> - <para> - ×ÖÌåÎļþ¸ñʽĿǰÊǶþ½øÖƵÄÇÒºÍÆ½Ì¨Óйء£ÕâÒâζ×ÅÓ¦¸ÃÓúÍÄãÔËÐÐ - PHP µÄ»úÆ÷ÏàͬÀàÐÍ CPU µÄ»úÆ÷Éú³É×ÖÌå¡£ - </para> - <para> - <table> - <title>×ÖÌåÎļþ¸ñʽ</title> - <tgroup cols="3"> - <thead> - <row> - <entry>×Ö½ÚλÖÃ</entry> - <entry>C Êý¾ÝÀàÐÍ</entry> - <entry>˵Ã÷</entry> - </row> - </thead> - <tbody> - <row> - <entry>byte 0-3</entry> - <entry>int</entry> - <entry>×ÖÌåÖеÄ×Ö·ûÊýÄ¿</entry> - </row> - <row> - <entry>byte 4-7</entry> - <entry>int</entry> - <entry>×ÖÌåÖеÚÒ»¸ö×Ö·ûµÄÖµ£¨Í¨³£ÊÇ 32 ´ú±í¿Õ¸ñ£©</entry> - </row> - <row> - <entry>byte 8-11</entry> - <entry>int</entry> - <entry>ÿ¸ö×Ö·û¿í¶ÈµÄÏñËØÖµ</entry> - </row> - <row> - <entry>byte 12-15</entry> - <entry>int</entry> - <entry>ÿ¸ö×Ö·û¸ß¶ÈµÄÏñËØÖµ</entry> - </row> - <row> - <entry>byte 16-</entry> - <entry>char</entry> - <entry> - ×Ö·ûÊý¾ÝµÄÊý×飬ÿ×Ö·ûÖÐÿÏñËØÒ»×Ö½Ú£¬Ò»¹² (nchars*width*height) ×Ö½Ú¡£ - </entry> - </row> - </tbody> - </tgroup> - </table> - </para> - <para> - <example> - <title>ʹÓà imageloadfont</title> - <programlisting role="php"> - <![CDATA[ - <?php - $im = imagecreate(50, 20); - $black = imagecolorallocate($im, 0, 0, 0); - $white = imagecolorallocate($im, 255, 255, 255); - imagefilledrectangle($im, 0, 0, 49, 19, $white); - $font = imageloadfont("04b.gdf"); - imagestring($im, $font, 0, 0, "Hello", $black); - imagepng($im); - ?> - ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>imagefontwidth</function> ºÍ - <function>imagefontheight</function>¡£ - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<refentry id="function.imageloadfont"> + <refnamediv> + <refname>imageloadfont</refname> + <refpurpose>ÔØÈëÒ»ÐÂ×ÖÌå</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>int</type><methodname>imageloadfont</methodname> + <methodparam><type>string</type><parameter>file</parameter></methodparam> + </methodsynopsis> + <para> + <function>imageloadfont</function> + ¼ÓÔØÒ»¸öÓû§¶¨ÒåµÄλͼ×ÖÌå²¢·µ»Ø¸Ã×ÖÌåµÄ±êʶ·û£¨ÆäÖµ×ÜÊÇ´óÓÚ + 5£¬Òò´Ë²»»áºÍÄÚÖÃ×ÖÌå³åÍ»£©¡£ + ÔÚ²úÉú´íÎóµÄÇé¿öÏ£¬¸Ãº¯Êý·µ»Ø &false; ¡£ + </para> + <para> + ×ÖÌåÎļþ¸ñʽĿǰÊǶþ½øÖƵÄÇÒºÍÆ½Ì¨Óйء£ÕâÒâζ×ÅÓ¦¸ÃÓúÍÄãÔËÐÐ + PHP µÄ»úÆ÷ÏàͬÀàÐÍ CPU µÄ»úÆ÷Éú³É×ÖÌå¡£ + </para> + <para> + <table> + <title>×ÖÌåÎļþ¸ñʽ</title> + <tgroup cols="3"> + <thead> + <row> + <entry>×Ö½ÚλÖÃ</entry> + <entry>C Êý¾ÝÀàÐÍ</entry> + <entry>˵Ã÷</entry> + </row> + </thead> + <tbody> + <row> + <entry>byte 0-3</entry> + <entry>int</entry> + <entry>×ÖÌåÖеÄ×Ö·ûÊýÄ¿</entry> + </row> + <row> + <entry>byte 4-7</entry> + <entry>int</entry> + <entry>×ÖÌåÖеÚÒ»¸ö×Ö·ûµÄÖµ£¨Í¨³£ÊÇ 32 ´ú±í¿Õ¸ñ£©</entry> + </row> + <row> + <entry>byte 8-11</entry> + <entry>int</entry> + <entry>ÿ¸ö×Ö·û¿í¶ÈµÄÏñËØÖµ</entry> + </row> + <row> + <entry>byte 12-15</entry> + <entry>int</entry> + <entry>ÿ¸ö×Ö·û¸ß¶ÈµÄÏñËØÖµ</entry> + </row> + <row> + <entry>byte 16-</entry> + <entry>char</entry> + <entry>×Ö·ûÊý¾ÝµÄÊý×飬ÿ×Ö·ûÖÐÿÏñËØÒ»×Ö½Ú£¬Ò»¹² (nchars*width*height) ×Ö½Ú¡£</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + <para> + <example> + <title>ʹÓà imageloadfont</title> + <programlisting role="php"> +<![CDATA[ +<?php +$im = imagecreatetruecolor(50, 20); +$black = imagecolorallocate($im, 0, 0, 0); +$white = imagecolorallocate($im, 255, 255, 255); +imagefilledrectangle($im, 0, 0, 49, 19, $white); +$font = imageloadfont("04b.gdf"); +imagestring($im, $font, 0, 0, "Hello", $black); +imagepng($im); +?> +]]> + </programlisting> + </example> + </para> + <para> + ²Î¼û <function>imagefontwidth</function> ºÍ + <function>imagefontheight</function>¡£ + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagesetpixel.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/image/functions/imagesetpixel.xml diff -u phpdoc-zh/reference/image/functions/imagesetpixel.xml:1.2 phpdoc-zh/reference/image/functions/imagesetpixel.xml:1.3 --- phpdoc-zh/reference/image/functions/imagesetpixel.xml:1.2 Fri Jul 15 11:48:45 2005 +++ phpdoc-zh/reference/image/functions/imagesetpixel.xml Sun Sep 4 03:34:49 2005 @@ -1,33 +1,33 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> - <refentry id="function.imagesetpixel"> - <refnamediv> - <refname>imagesetpixel</refname> - <refpurpose>»Ò»¸öµ¥Ò»ÏñËØ</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>imagesetpixel</methodname> - <methodparam><type>resource</type><parameter>image</parameter></methodparam> - <methodparam><type>int</type><parameter>x</parameter></methodparam> - <methodparam><type>int</type><parameter>y</parameter></methodparam> - <methodparam><type>int</type><parameter>color</parameter></methodparam> - </methodsynopsis> - <para> - <function>imagesetpixel</function> ÔÚ <parameter>image</parameter> - ͼÏñÖÐÓà <parameter>color</parameter> - ÑÕÉ«ÔÚ <parameter>x</parameter>, <parameter>y</parameter> ×ø±ê£¨Í¼Ïñ×óÉϽÇΪ - 0, 0£©Éϻһ¸öµã¡£ - </para> - <para> - ²Î¼û <function>imagecreate</function> ºÍ - <function>imagecolorallocate</function>¡£ - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.imagesetpixel"> + <refnamediv> + <refname>imagesetpixel</refname> + <refpurpose>»Ò»¸öµ¥Ò»ÏñËØ</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagesetpixel</methodname> + <methodparam><type>resource</type><parameter>image</parameter></methodparam> + <methodparam><type>int</type><parameter>x</parameter></methodparam> + <methodparam><type>int</type><parameter>y</parameter></methodparam> + <methodparam><type>int</type><parameter>color</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagesetpixel</function> ÔÚ <parameter>image</parameter> + ͼÏñÖÐÓà <parameter>color</parameter> + ÑÕÉ«ÔÚ <parameter>x</parameter>£¬<parameter>y</parameter> ×ø±ê£¨Í¼Ïñ×óÉϽÇΪ + 0£¬0£©Éϻһ¸öµã¡£ + </para> + <para> + ²Î¼û <function>imagecreatetruecolor</function> ºÍ + <function>imagecolorallocate</function>¡£ + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagewbmp.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/image/functions/imagewbmp.xml diff -u phpdoc-zh/reference/image/functions/imagewbmp.xml:1.2 phpdoc-zh/reference/image/functions/imagewbmp.xml:1.3 --- phpdoc-zh/reference/image/functions/imagewbmp.xml:1.2 Fri Jul 15 11:48:46 2005 +++ phpdoc-zh/reference/image/functions/imagewbmp.xml Sun Sep 4 03:34:49 2005 @@ -1,46 +1,46 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.imagewbmp"> - <refnamediv> - <refname>imagewbmp</refname> - <refpurpose>ÒÔ WBMP ¸ñʽ½«Í¼ÏñÊä³öµ½ä¯ÀÀÆ÷»òÎļþ</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>imagewbmp</methodname> - <methodparam><type>resource</type><parameter>image</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>foreground</parameter></methodparam> - </methodsynopsis> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<refentry id="function.imagewbmp"> + <refnamediv> + <refname>imagewbmp</refname> + <refpurpose>ÒÔ WBMP ¸ñʽ½«Í¼ÏñÊä³öµ½ä¯ÀÀÆ÷»òÎļþ</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagewbmp</methodname> + <methodparam><type>resource</type><parameter>image</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>foreground</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagewbmp</function> ´Ó + <parameter>image</parameter> ͼÏñ´´½¨Ò»¸öÃûΪ <parameter>filename</parameter> µÄ + <acronym>WBMP</acronym> Îļþ¡£<parameter>image</parameter> + ²ÎÊýÊÇ <function>imagecreatetruecolor</function> µÄ·µ»ØÖµ¡£ + </para> + <para> + <parameter>filename</parameter> ²ÎÊýÊÇ¿ÉÑ¡ÏÈç¹ûÊ¡ÂÔ£¬ÔòÖ±½Ó½«ÔͼÏñÁ÷Êä³ö¡£Í¨¹ýÓà + <function>header</function> ·¢ËÍ <acronym>image/vnd.wap.wbmp</acronym> + µÄ Content-type£¬¿ÉÒÔ´´½¨Ö±½ÓÊä³ö WBMP ͼÏñµÄ PHP ½Å±¾¡£ + <note> <para> - <function>imagewbmp</function> ´Ó - <parameter>image</parameter> ͼÏñ´´½¨Ò»¸öÃûΪ <parameter>filename</parameter> µÄ - <acronym>WBMP</acronym> Îļþ¡£<parameter>image</parameter> - ²ÎÊýÊÇ <function>imagecreate</function> µÄ·µ»ØÖµ¡£ + WBMP Ö§³Ö½öÄÜÓÃÓÚ PHP ±àÒëʱ¼ÓÈëÁË GD-1.8 »ò¸ü¸ß°æ±¾Ê±¡£ </para> - <para> - <parameter>filename</parameter> ²ÎÊýÊÇ¿ÉÑ¡ÏÈç¹ûÊ¡ÂÔ£¬ÔòÖ±½Ó½«ÔͼÏñÁ÷Êä³ö¡£Í¨¹ýÓà - <function>header</function> ·¢ËÍ <acronym>image/vnd.wap.wbmp</acronym> - µÄ Content-type£¬¿ÉÒÔ´´½¨Ö±½ÓÊä³ö WBMP ͼÏñµÄ PHP ½Å±¾¡£ - <note> - <para> - WBMP Ö§³Ö½öÄÜÓÃÓÚ PHP ±àÒëʱ¼ÓÈëÁË GD-1.8 »ò¸ü¸ß°æ±¾Ê±¡£ - </para> - </note> - </para> - <para> - ÓÿÉÑ¡µÄ <parameter>foreground</parameter> ²ÎÊý¿ÉÒÔÉ趨ǰ¾°É«£¬Óà - <function>imagecolorallocate</function> º¯Êý·µ»ØµÄÑÕÉ«±êʶ·û¡£Ä¬ÈÏǰ¾°É«ÊǺÚÉ«¡£ - </para> - <para> - ²Î¼û <function>image2wbmp</function>£¬<function>imagepng</function>£¬<function>imagegif</function>£¬<function>imagejpeg</function> - ºÍ <function>imagetypes</function>¡£ - </para> - </refsect1> - </refentry> + </note> + </para> + <para> + ÓÿÉÑ¡µÄ <parameter>foreground</parameter> ²ÎÊý¿ÉÒÔÉ趨ǰ¾°É«£¬Óà + <function>imagecolorallocate</function> º¯Êý·µ»ØµÄÑÕÉ«±êʶ·û¡£Ä¬ÈÏǰ¾°É«ÊǺÚÉ«¡£ + </para> + <para> + ²Î¼û <function>image2wbmp</function>£¬<function>imagepng</function>£¬<function>imagegif</function>£¬<function>imagejpeg</function> + ºÍ <function>imagetypes</function>¡£ + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables:
http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagecopymerge.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/image/functions/imagecopymerge.xml diff -u phpdoc-zh/reference/image/functions/imagecopymerge.xml:1.1 phpdoc-zh/reference/image/functions/imagecopymerge.xml:1.2 --- phpdoc-zh/reference/image/functions/imagecopymerge.xml:1.1 Thu Aug 28 00:08:14 2003 +++ phpdoc-zh/reference/image/functions/imagecopymerge.xml Sun Sep 4 03:34:48 2005 @@ -1,44 +1,45 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> - <refentry id="function.imagecopymerge"> - <refnamediv> - <refname>imagecopymerge</refname> - <refpurpose>¿½±´²¢ºÏ²¢Í¼ÏñµÄÒ»²¿·Ö</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>imagecopymerge</methodname> - <methodparam><type>resource</type><parameter>dst_im</parameter></methodparam> - <methodparam><type>resource</type><parameter>src_im</parameter></methodparam> - <methodparam><type>int</type><parameter>dst_x</parameter></methodparam> - <methodparam><type>int</type><parameter>dst_y</parameter></methodparam> - <methodparam><type>int</type><parameter>src_x</parameter></methodparam> - <methodparam><type>int</type><parameter>src_y</parameter></methodparam> - <methodparam><type>int</type><parameter>src_w</parameter></methodparam> - <methodparam><type>int</type><parameter>src_h</parameter></methodparam> - <methodparam><type>int</type><parameter>pct</parameter></methodparam> - </methodsynopsis> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<refentry id="function.imagecopymerge"> + <refnamediv> + <refname>imagecopymerge</refname> + <refpurpose>¿½±´²¢ºÏ²¢Í¼ÏñµÄÒ»²¿·Ö</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagecopymerge</methodname> + <methodparam><type>resource</type><parameter>dst_im</parameter></methodparam> + <methodparam><type>resource</type><parameter>src_im</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_x</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_y</parameter></methodparam> + <methodparam><type>int</type><parameter>src_x</parameter></methodparam> + <methodparam><type>int</type><parameter>src_y</parameter></methodparam> + <methodparam><type>int</type><parameter>src_w</parameter></methodparam> + <methodparam><type>int</type><parameter>src_h</parameter></methodparam> + <methodparam><type>int</type><parameter>pct</parameter></methodparam> + </methodsynopsis> + <para> + ½« <parameter>src_im</parameter> ͼÏñÖÐ×ø±ê´Ó + <parameter>src_x</parameter>£¬<parameter>src_y </parameter> + ¿ªÊ¼£¬¿í¶ÈΪ <parameter>src_w</parameter>£¬¸ß¶ÈΪ <parameter>src_h</parameter> + µÄÒ»²¿·Ö¿½±´µ½ + <parameter>dst_im</parameter> ͼÏñÖÐ×ø±êΪ + <parameter>dst_x</parameter> ºÍ <parameter>dst_y</parameter> + µÄλÖÃÉÏ¡£Á½Í¼Ïñ½«¸ù¾Ý <parameter>pct</parameter> + À´¾ö¶¨ºÏ²¢³Ì¶È£¬ÆäÖµ·¶Î§´Ó 0 µ½ 100¡£µ± <parameter>pct</parameter> = 0 + ʱ£¬Êµ¼ÊÉÏʲôҲû×ö£¬µ±Îª 100 ʱ¶ÔÓÚµ÷É«°åͼÏñ±¾º¯ÊýºÍ + <function>imagecopy</function> ÍêȫһÑù£¬Ëü¶ÔÕæ²ÊɫͼÏñʵÏÖÁË alpha ͸Ã÷¡£ + </para> + <note> <para> - ½« <parameter>src_im</parameter> ͼÏñÖÐ×ø±ê´Ó - <parameter>src_x</parameter>£¬<parameter>src_y </parameter> - ¿ªÊ¼£¬¿í¶ÈΪ <parameter>src_w</parameter>£¬¸ß¶ÈΪ <parameter>src_h</parameter> - µÄÒ»²¿·Ö¿½±´µ½ - <parameter>dst_im</parameter> ͼÏñÖÐ×ø±êΪ - <parameter>dst_x</parameter> ºÍ <parameter>dst_y</parameter> - µÄλÖÃÉÏ¡£Á½Í¼Ïñ½«¸ù¾Ý <parameter>pct</parameter> - À´¾ö¶¨ºÏ²¢³Ì¶È£¬ÆäÖµ·¶Î§´Ó 0 µ½ 100¡£µ± <parameter>pct</parameter> = 0 - ʱ£¬Êµ¼ÊÉÏʲôҲû×ö£¬µ±Îª 100 ʱ±¾º¯ÊýºÍ <function>imagecopy</function> ÍêȫһÑù¡£ + ±¾º¯ÊýÊÇ PHP 4.0.6 мӵġ£ </para> - <note> - <para> - ÕâÊÇ PHP 4.0.6 мӵġ£ - </para> - </note> - </refsect1> - </refentry> + </note> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagecopyresampled.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/image/functions/imagecopyresampled.xml diff -u phpdoc-zh/reference/image/functions/imagecopyresampled.xml:1.1 phpdoc-zh/reference/image/functions/imagecopyresampled.xml:1.2 --- phpdoc-zh/reference/image/functions/imagecopyresampled.xml:1.1 Thu Aug 28 00:08:14 2003 +++ phpdoc-zh/reference/image/functions/imagecopyresampled.xml Sun Sep 4 03:34:49 2005 @@ -1,52 +1,135 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> - <refentry id="function.imagecopyresampled"> - <refnamediv> - <refname>imagecopyresampled</refname> - <refpurpose>ÖØ²ÉÑù¿½±´²¿·ÖͼÏñ²¢µ÷Õû´óС</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>imagecopyresampled</methodname> - <methodparam><type>resource</type><parameter>dst_im</parameter></methodparam> - <methodparam><type>resource</type><parameter>src_im</parameter></methodparam> - <methodparam><type>int</type><parameter>dstX</parameter></methodparam> - <methodparam><type>int</type><parameter>dstY</parameter></methodparam> - <methodparam><type>int</type><parameter>srcX</parameter></methodparam> - <methodparam><type>int</type><parameter>srcY</parameter></methodparam> - <methodparam><type>int</type><parameter>dstW</parameter></methodparam> - <methodparam><type>int</type><parameter>dstH</parameter></methodparam> - <methodparam><type>int</type><parameter>srcW</parameter></methodparam> - <methodparam><type>int</type><parameter>srcH</parameter></methodparam> - </methodsynopsis> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.imagecopyresampled"> + <refnamediv> + <refname>imagecopyresampled</refname> + <refpurpose>ÖØ²ÉÑù¿½±´²¿·ÖͼÏñ²¢µ÷Õû´óС</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagecopyresampled</methodname> + <methodparam><type>resource</type><parameter>dst_image</parameter></methodparam> + <methodparam><type>resource</type><parameter>src_image</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_x</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_y</parameter></methodparam> + <methodparam><type>int</type><parameter>src_x</parameter></methodparam> + <methodparam><type>int</type><parameter>src_y</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_w</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_h</parameter></methodparam> + <methodparam><type>int</type><parameter>src_w</parameter></methodparam> + <methodparam><type>int</type><parameter>src_h</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagecopyresampled</function> + ½«Ò»·ùͼÏñÖеÄÒ»¿éÕý·½ÐÎÇøÓò¿½±´µ½ÁíÒ»¸öͼÏñÖУ¬Æ½»¬µØ²åÈëÏñËØÖµ£¬Òò´Ë£¬ÓÈÆäÊÇ£¬¼õСÁËͼÏñµÄ´óС¶øÈÔÈ»±£³ÖÁ˼«´óµÄÇåÎú¶È¡£&return.success; + </para> + <para> + <parameter>dst_image</parameter> + ºÍ <parameter>src_image</parameter> + ·Ö±ðÊÇÄ¿±êͼÏñºÍԴͼÏñµÄ±êʶ·û¡£Èç¹ûÔ´ºÍÄ¿±êµÄ¿í¶ÈºÍ¸ß¶È²»Í¬£¬Ôò»á½øÐÐÏàÓ¦µÄͼÏñÊÕËõºÍÀÉì¡£×ø±êÖ¸µÄÊÇ×óÉϽǡ£±¾º¯Êý¿ÉÓÃÀ´ÔÚͬһ·ùͼÄÚ²¿¿½±´£¨Èç¹û + <parameter>dst_image</parameter> ºÍ <parameter>src_image</parameter> + ÏàͬµÄ»°£©ÇøÓò£¬µ«Èç¹ûÇøÓò½»µüµÄ»°Ôò½á¹û²»¿ÉÔ¤Öª¡£ + </para> + <note> <para> - <function>imagecopyresampled</function> - ½«Ò»·ùͼÏñÖеÄÒ»¿éÕý·½ÐÎÇøÓò¿½±´µ½ÁíÒ»¸öͼÏñÖУ¬Æ½»¬µØ²åÈëÏñËØÖµ£¬Òò´Ë£¬ÓÈÆäÊÇ£¬¼õСÁËͼÏñµÄ´óС¶øÈÔÈ»±£³ÖÁ˼«´óµÄÇåÎú¶È¡£<parameter>dst_im</parameter> - ºÍ <parameter>src_im</parameter> - ·Ö±ðÊÇÄ¿±êͼÏñºÍԴͼÏñµÄ±êʶ·û¡£Èç¹ûÔ´ºÍÄ¿±êµÄ¿í¶ÈºÍ¸ß¶È²»Í¬£¬Ôò»á½øÐÐÏàÓ¦µÄͼÏñÊÕËõºÍÀÉì¡£×ø±êÖ¸µÄÊÇ×óÉϽǡ£±¾º¯Êý¿ÉÓÃÀ´ÔÚͬһ·ùͼÄÚ²¿¿½±´£¨Èç¹û - <parameter>dst_im</parameter> ºÍ <parameter>src_im</parameter> - ÏàͬµÄ»°£©ÇøÓò£¬µ«Èç¹ûÇøÓò½»µüµÄ»°Ôò½á¹û²»¿ÉÔ¤Öª¡£ + ÒòΪµ÷É«°åͼÏñÏÞÖÆ£¨255+1 ÖÖÑÕÉ«£©ÓиöÎÊÌâ¡£ÖØ²ÉÑù»ò¹ýÂËͼÏñͨ³£ÐèÒª¶àÓÚ 255 + ÖÖÑÕÉ«£¬¼ÆËãеı»ÖزÉÑùµÄÏñËØ¼°ÆäÑÕɫʱ²ÉÓÃÁËÒ»ÖÖ½üËÆÖµ¡£¶Ôµ÷É«°åͼÏñ³¢ÊÔ·ÖÅäÒ»¸öÐÂÑÕɫʱ£¬Èç¹ûʧ°ÜÎÒÃÇÑ¡ÔñÁ˼ÆËã½á¹û×î½Ó½ü£¨ÀíÂÛÉÏ£©µÄÑÕÉ«¡£Õâ²¢²»×ÜÊÇÊÓ¾õÉÏ×î½Ó½üµÄÑÕÉ«¡£Õâ¿ÉÄÜ»á²úÉú¹ÖÒìµÄ½á¹û£¬ÀýÈç¿Õ°×£¨»òÕßÊÓ¾õÉÏÊǿհף©µÄͼÏñ¡£ÒªÌø¹ýÕâ¸öÎÊÌ⣬ÇëʹÓÃÕæ²ÊɫͼÏñ×÷ΪĿ±êͼÏñ£¬ÀýÈçÓà + <function>imagecreatetruecolor</function> ´´½¨µÄ¡£ </para> - <note> - <para> - ÒòΪµ÷É«°åͼÏñÏÞÖÆ£¨255+1 ÖÖÑÕÉ«£©ÓиöÎÊÌâ¡£ÖØ²ÉÑù»ò¹ýÂËͼÏñͨ³£ÐèÒª¶àÓÚ 255 - ÖÖÑÕÉ«£¬¼ÆËãеı»ÖزÉÑùµÄÏñËØ¼°ÆäÑÕɫʱ²ÉÓÃÁËÒ»ÖÖ½üËÆÖµ¡£¶Ôµ÷É«°åͼÏñ³¢ÊÔ·ÖÅäÒ»¸öÐÂÑÕɫʱ£¬Èç¹ûʧ°ÜÎÒÃÇÑ¡ÔñÁ˼ÆËã½á¹û×î½Ó½ü£¨ÀíÂÛÉÏ£©µÄÑÕÉ«¡£Õâ²¢²»×ÜÊÇÊÓ¾õÉÏ×î½Ó½üµÄÑÕÉ«¡£Õâ¿ÉÄÜ»á²úÉú¹ÖÒìµÄ½á¹û£¬ÀýÈç¿Õ°×£¨»òÕßÊÓ¾õÉÏÊǿհף©µÄͼÏñ¡£ÒªÌø¹ýÕâ¸öÎÊÌ⣬ÇëʹÓÃÕæ²ÊɫͼÏñ×÷ΪĿ±êͼÏñ£¬ÀýÈçÓà - <function>imagecreatetruecolor</function> ´´½¨µÄ¡£ - </para> - </note> - <note> + </note> + ¬e.gd.2; + </refsect1> + + <refsect1> + + &reftitle.examples; + + <para> + <example> + <title>¼òµ¥Àý×Ó</title> <para> - <function>imagecopyresampled</function> ÐèÒª GD 2.0.l »ò¸ü¸ß°æ±¾¡£ + ±¾ÀýÖн«°ÑÒ»·ùͼÏñÖØ²ÉÑùΪÔʼ´óСµÄÒ»°ë¡£ </para> - </note> + <programlisting role="php"> +<![CDATA[ +<?php +// The file +$filename = 'test.jpg'; +$percent = 0.5; + +// Content type +header('Content-type: image/jpeg'); + +// Get new dimensions +list($width, $height) = getimagesize($filename); +$new_width = $width * $percent; +$new_height = $height * $percent; + +// Resample +$image_p = imagecreatetruecolor($new_width, $new_height); +$image = imagecreatefromjpeg($filename); +imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); + +// Output +imagejpeg($image_p, null, 100); +?> +]]> + </programlisting> + </example> + </para> + <para> - ²Î¼û <function>imagecopyresized</function>¡£ + <example> + <title>°´±ÈÀýÖØ²ÉÑùͼÏñ</title> + <para> + ±¾Àý½«°ÑÒ»·ùͼÏñ°´×î¿í»ò×î¸ß 200 ÏñËØÀ´ÏÔʾ¡£ + </para> + <programlisting role="php"> +<![CDATA[ +<?php +// The file +$filename = 'test.jpg'; + +// Set a maximum height and width +$width = 200; +$height = 200; + +// Content type +header('Content-type: image/jpeg'); + +// Get new dimensions +list($width_orig, $height_orig) = getimagesize($filename); + +if ($width && ($width_orig < $height_orig)) { + $width = ($height / $height_orig) * $width_orig; +} else { + $height = ($width / $width_orig) * $height_orig; +} + +// Resample +$image_p = imagecreatetruecolor($width, $height); +$image = imagecreatefromjpeg($filename); +imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); + +// Output +imagejpeg($image_p, null, 100); +?> +]]> + </programlisting> + </example> </para> </refsect1> - </refentry> + + <refsect1> + &reftitle.seealso; + <para> + <function>imagecopyresized</function> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagecopyresized.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/image/functions/imagecopyresized.xml diff -u phpdoc-zh/reference/image/functions/imagecopyresized.xml:1.1 phpdoc-zh/reference/image/functions/imagecopyresized.xml:1.2 --- phpdoc-zh/reference/image/functions/imagecopyresized.xml:1.1 Thu Aug 28 00:08:14 2003 +++ phpdoc-zh/reference/image/functions/imagecopyresized.xml Sun Sep 4 03:34:49 2005 @@ -1,47 +1,94 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> - <refentry id="function.imagecopyresized"> - <refnamediv> - <refname>imagecopyresized</refname> - <refpurpose>¿½±´²¿·ÖͼÏñ²¢µ÷Õû´óС</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>imagecopyresized</methodname> - <methodparam><type>resource</type><parameter>dst_im</parameter></methodparam> - <methodparam><type>resource</type><parameter>src_im</parameter></methodparam> - <methodparam><type>int</type><parameter>dstX</parameter></methodparam> - <methodparam><type>int</type><parameter>dstY</parameter></methodparam> - <methodparam><type>int</type><parameter>srcX</parameter></methodparam> - <methodparam><type>int</type><parameter>srcY</parameter></methodparam> - <methodparam><type>int</type><parameter>dstW</parameter></methodparam> - <methodparam><type>int</type><parameter>dstH</parameter></methodparam> - <methodparam><type>int</type><parameter>srcW</parameter></methodparam> - <methodparam><type>int</type><parameter>srcH</parameter></methodparam> - </methodsynopsis> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.imagecopyresized"> + <refnamediv> + <refname>imagecopyresized</refname> + <refpurpose>¿½±´²¿·ÖͼÏñ²¢µ÷Õû´óС</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagecopyresized</methodname> + <methodparam><type>resource</type><parameter>dst_image</parameter></methodparam> + <methodparam><type>resource</type><parameter>src_image</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_x</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_y</parameter></methodparam> + <methodparam><type>int</type><parameter>src_x</parameter></methodparam> + <methodparam><type>int</type><parameter>src_y</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_w</parameter></methodparam> + <methodparam><type>int</type><parameter>dst_h</parameter></methodparam> + <methodparam><type>int</type><parameter>src_w</parameter></methodparam> + <methodparam><type>int</type><parameter>src_h</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagecopyresized</function> + ½«Ò»·ùͼÏñÖеÄÒ»¿éÕý·½ÐÎÇøÓò¿½±´µ½ÁíÒ»¸öͼÏñÖС£<parameter>dst_image</parameter> + ºÍ <parameter>src_image</parameter> + ·Ö±ðÊÇÄ¿±êͼÏñºÍԴͼÏñµÄ±êʶ·û¡£Èç¹ûÔ´ºÍÄ¿±êµÄ¿í¶ÈºÍ¸ß¶È²»Í¬£¬Ôò»á½øÐÐÏàÓ¦µÄͼÏñÊÕËõºÍÀÉì¡£×ø±êÖ¸µÄÊÇ×óÉϽǡ£±¾º¯Êý¿ÉÓÃÀ´ÔÚͬһ·ùͼÄÚ²¿¿½±´£¨Èç¹û + <parameter>dst_image</parameter> ºÍ <parameter>src_image</parameter> + ÏàͬµÄ»°£©ÇøÓò£¬µ«Èç¹ûÇøÓò½»µüµÄ»°Ôò½á¹û²»¿ÉÔ¤Öª¡£ + </para> + <note> <para> - <function>imagecopyresized</function> - ½«Ò»·ùͼÏñÖеÄÒ»¿éÕý·½ÐÎÇøÓò¿½±´µ½ÁíÒ»¸öͼÏñÖС£<parameter>dst_im</parameter> - ºÍ <parameter>src_im</parameter> - ·Ö±ðÊÇÄ¿±êͼÏñºÍԴͼÏñµÄ±êʶ·û¡£Èç¹ûÔ´ºÍÄ¿±êµÄ¿í¶ÈºÍ¸ß¶È²»Í¬£¬Ôò»á½øÐÐÏàÓ¦µÄͼÏñÊÕËõºÍÀÉì¡£×ø±êÖ¸µÄÊÇ×óÉϽǡ£±¾º¯Êý¿ÉÓÃÀ´ÔÚͬһ·ùͼÄÚ²¿¿½±´£¨Èç¹û - <parameter>dst_im</parameter> ºÍ <parameter>src_im</parameter> - ÏàͬµÄ»°£©ÇøÓò£¬µ«Èç¹ûÇøÓò½»µüµÄ»°Ôò½á¹û²»¿ÉÔ¤Öª¡£ + ÒòΪµ÷É«°åͼÏñÏÞÖÆ£¨255+1 ÖÖÑÕÉ«£©ÓиöÎÊÌâ¡£ÖØ²ÉÑù»ò¹ýÂËͼÏñͨ³£ÐèÒª¶àÓÚ 255 + ÖÖÑÕÉ«£¬¼ÆËãеı»ÖزÉÑùµÄÏñËØ¼°ÆäÑÕɫʱ²ÉÓÃÁËÒ»ÖÖ½üËÆÖµ¡£¶Ôµ÷É«°åͼÏñ³¢ÊÔ·ÖÅäÒ»¸öÐÂÑÕɫʱ£¬Èç¹ûʧ°ÜÎÒÃÇÑ¡ÔñÁ˼ÆËã½á¹û×î½Ó½ü£¨ÀíÂÛÉÏ£©µÄÑÕÉ«¡£Õâ²¢²»×ÜÊÇÊÓ¾õÉÏ×î½Ó½üµÄÑÕÉ«¡£Õâ¿ÉÄÜ»á²úÉú¹ÖÒìµÄ½á¹û£¬ÀýÈç¿Õ°×£¨»òÕßÊÓ¾õÉÏÊǿհף©µÄͼÏñ¡£ÒªÌø¹ýÕâ¸öÎÊÌ⣬ÇëʹÓÃÕæ²ÊɫͼÏñ×÷ΪĿ±êͼÏñ£¬ÀýÈçÓà + <function>imagecreatetruecolor</function> ´´½¨µÄ¡£ </para> - <note> + </note> + </refsect1> + + <refsect1> + &reftitle.examples; + <para> + <example> + <title>µ÷ÕûͼÏñ´óС</title> <para> - ÒòΪµ÷É«°åͼÏñÏÞÖÆ£¨255+1 ÖÖÑÕÉ«£©ÓиöÎÊÌâ¡£ÖØ²ÉÑù»ò¹ýÂËͼÏñͨ³£ÐèÒª¶àÓÚ 255 - ÖÖÑÕÉ«£¬¼ÆËãеı»ÖزÉÑùµÄÏñËØ¼°ÆäÑÕɫʱ²ÉÓÃÁËÒ»ÖÖ½üËÆÖµ¡£¶Ôµ÷É«°åͼÏñ³¢ÊÔ·ÖÅäÒ»¸öÐÂÑÕɫʱ£¬Èç¹ûʧ°ÜÎÒÃÇÑ¡ÔñÁ˼ÆËã½á¹û×î½Ó½ü£¨ÀíÂÛÉÏ£©µÄÑÕÉ«¡£Õâ²¢²»×ÜÊÇÊÓ¾õÉÏ×î½Ó½üµÄÑÕÉ«¡£Õâ¿ÉÄÜ»á²úÉú¹ÖÒìµÄ½á¹û£¬ÀýÈç¿Õ°×£¨»òÕßÊÓ¾õÉÏÊǿհף©µÄͼÏñ¡£ÒªÌø¹ýÕâ¸öÎÊÌ⣬ÇëʹÓÃÕæ²ÊɫͼÏñ×÷ΪĿ±êͼÏñ£¬ÀýÈçÓà - <function>imagecreatetruecolor</function> ´´½¨µÄ¡£ + ±¾Àý½«ÒÔÔÀ´µÄÒ»°ë´óСÏÔʾͼÏñ¡£ </para> - </note> - <para> - ²Î¼û <function>imagecopyresampled</function>¡£ - </para> - </refsect1> - </refentry> + <programlisting role="php"> +<![CDATA[ +<?php +// File and new size +$filename = 'test.jpg'; +$percent = 0.5; + +// Content type +header('Content-type: image/jpeg'); + +// Get new sizes +list($width, $height) = getimagesize($filename); +$newwidth = $width * $percent; +$newheight = $height * $percent; + +// Load +$thumb = imagecreatetruecolor($newwidth, $newheight); +$source = imagecreatefromjpeg($filename); + +// Resize +imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + +// Output +imagejpeg($thumb); +?> +]]> + </programlisting> + <para> + ͼÏñ½«ÒÔÒ»°ë´óСÊä³ö£¬²»¹ý¿ÉÒÔÓà + <function>imagecopyresampled</function> µÃµ½¸üºÃµÄÖÊÁ¿¡£ + </para> + </example> + </para> + </refsect1> + + <refsect1> + &reftitle.seealso; + <para> + <function>imagecopyresampled</function> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagedestroy.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/image/functions/imagedestroy.xml diff -u phpdoc-zh/reference/image/functions/imagedestroy.xml:1.2 phpdoc-zh/reference/image/functions/imagedestroy.xml:1.3 --- phpdoc-zh/reference/image/functions/imagedestroy.xml:1.2 Fri Jul 15 11:37:55 2005 +++ phpdoc-zh/reference/image/functions/imagedestroy.xml Sun Sep 4 03:34:49 2005 @@ -1,25 +1,26 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.imagedestroy"> - <refnamediv> - <refname>imagedestroy</refname> - <refpurpose>Ïú»ÙһͼÏñ</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>imagedestroy</methodname> - <methodparam><type>resource</type><parameter>image</parameter></methodparam> - </methodsynopsis> - <para> - <function>imagedestroy</function> ÊÍ·ÅÓë - <parameter>image</parameter> ¹ØÁªµÄÄÚ´æ¡£<parameter>image</parameter> - ÊÇ <function>imagecreate</function> º¯Êý·µ»ØµÄͼÏñ±êʶ·û¡£ - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<refentry id="function.imagedestroy"> + <refnamediv> + <refname>imagedestroy</refname> + <refpurpose>Ïú»ÙһͼÏñ</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagedestroy</methodname> + <methodparam><type>resource</type><parameter>image</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagedestroy</function> ÊÍ·ÅÓë + <parameter>image</parameter> ¹ØÁªµÄÄÚ´æ¡£<parameter>image</parameter> + ÊÇÓÉͼÏñ´´½¨º¯Êý·µ»ØµÄͼÏñ±êʶ·û£¬ÀýÈç + <function>imagecreatetruecolor</function>¡£ + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imageloadfont.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/image/functions/imageloadfont.xml diff -u phpdoc-zh/reference/image/functions/imageloadfont.xml:1.2 phpdoc-zh/reference/image/functions/imageloadfont.xml:1.3 --- phpdoc-zh/reference/image/functions/imageloadfont.xml:1.2 Fri Jul 15 11:59:12 2005 +++ phpdoc-zh/reference/image/functions/imageloadfont.xml Sun Sep 4 03:34:49 2005 @@ -1,95 +1,93 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> - <refentry id="function.imageloadfont"> - <refnamediv> - <refname>imageloadfont</refname> - <refpurpose>ÔØÈëÒ»ÐÂ×ÖÌå</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>int</type><methodname>imageloadfont</methodname> - <methodparam><type>string</type><parameter>file</parameter></methodparam> - </methodsynopsis> - <para> - <function>imageloadfont</function> - ¼ÓÔØÒ»¸öÓû§¶¨ÒåµÄλͼ×ÖÌå²¢·µ»Ø¸Ã×ÖÌåµÄ±êʶ·û£¨ÆäÖµ×ÜÊÇ´óÓÚ - 5£¬Òò´Ë²»»áºÍÄÚÖÃ×ÖÌå³åÍ»£©¡£ - ÔÚ²úÉú´íÎóµÄÇé¿öÏ£¬¸Ãº¯Êý·µ»Ø &false; ¡£ - </para> - <para> - ×ÖÌåÎļþ¸ñʽĿǰÊǶþ½øÖƵÄÇÒºÍÆ½Ì¨Óйء£ÕâÒâζ×ÅÓ¦¸ÃÓúÍÄãÔËÐÐ - PHP µÄ»úÆ÷ÏàͬÀàÐÍ CPU µÄ»úÆ÷Éú³É×ÖÌå¡£ - </para> - <para> - <table> - <title>×ÖÌåÎļþ¸ñʽ</title> - <tgroup cols="3"> - <thead> - <row> - <entry>×Ö½ÚλÖÃ</entry> - <entry>C Êý¾ÝÀàÐÍ</entry> - <entry>˵Ã÷</entry> - </row> - </thead> - <tbody> - <row> - <entry>byte 0-3</entry> - <entry>int</entry> - <entry>×ÖÌåÖеÄ×Ö·ûÊýÄ¿</entry> - </row> - <row> - <entry>byte 4-7</entry> - <entry>int</entry> - <entry>×ÖÌåÖеÚÒ»¸ö×Ö·ûµÄÖµ£¨Í¨³£ÊÇ 32 ´ú±í¿Õ¸ñ£©</entry> - </row> - <row> - <entry>byte 8-11</entry> - <entry>int</entry> - <entry>ÿ¸ö×Ö·û¿í¶ÈµÄÏñËØÖµ</entry> - </row> - <row> - <entry>byte 12-15</entry> - <entry>int</entry> - <entry>ÿ¸ö×Ö·û¸ß¶ÈµÄÏñËØÖµ</entry> - </row> - <row> - <entry>byte 16-</entry> - <entry>char</entry> - <entry> - ×Ö·ûÊý¾ÝµÄÊý×飬ÿ×Ö·ûÖÐÿÏñËØÒ»×Ö½Ú£¬Ò»¹² (nchars*width*height) ×Ö½Ú¡£ - </entry> - </row> - </tbody> - </tgroup> - </table> - </para> - <para> - <example> - <title>ʹÓà imageloadfont</title> - <programlisting role="php"> - <![CDATA[ - <?php - $im = imagecreate(50, 20); - $black = imagecolorallocate($im, 0, 0, 0); - $white = imagecolorallocate($im, 255, 255, 255); - imagefilledrectangle($im, 0, 0, 49, 19, $white); - $font = imageloadfont("04b.gdf"); - imagestring($im, $font, 0, 0, "Hello", $black); - imagepng($im); - ?> - ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>imagefontwidth</function> ºÍ - <function>imagefontheight</function>¡£ - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<refentry id="function.imageloadfont"> + <refnamediv> + <refname>imageloadfont</refname> + <refpurpose>ÔØÈëÒ»ÐÂ×ÖÌå</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>int</type><methodname>imageloadfont</methodname> + <methodparam><type>string</type><parameter>file</parameter></methodparam> + </methodsynopsis> + <para> + <function>imageloadfont</function> + ¼ÓÔØÒ»¸öÓû§¶¨ÒåµÄλͼ×ÖÌå²¢·µ»Ø¸Ã×ÖÌåµÄ±êʶ·û£¨ÆäÖµ×ÜÊÇ´óÓÚ + 5£¬Òò´Ë²»»áºÍÄÚÖÃ×ÖÌå³åÍ»£©¡£ + ÔÚ²úÉú´íÎóµÄÇé¿öÏ£¬¸Ãº¯Êý·µ»Ø &false; ¡£ + </para> + <para> + ×ÖÌåÎļþ¸ñʽĿǰÊǶþ½øÖƵÄÇÒºÍÆ½Ì¨Óйء£ÕâÒâζ×ÅÓ¦¸ÃÓúÍÄãÔËÐÐ + PHP µÄ»úÆ÷ÏàͬÀàÐÍ CPU µÄ»úÆ÷Éú³É×ÖÌå¡£ + </para> + <para> + <table> + <title>×ÖÌåÎļþ¸ñʽ</title> + <tgroup cols="3"> + <thead> + <row> + <entry>×Ö½ÚλÖÃ</entry> + <entry>C Êý¾ÝÀàÐÍ</entry> + <entry>˵Ã÷</entry> + </row> + </thead> + <tbody> + <row> + <entry>byte 0-3</entry> + <entry>int</entry> + <entry>×ÖÌåÖеÄ×Ö·ûÊýÄ¿</entry> + </row> + <row> + <entry>byte 4-7</entry> + <entry>int</entry> + <entry>×ÖÌåÖеÚÒ»¸ö×Ö·ûµÄÖµ£¨Í¨³£ÊÇ 32 ´ú±í¿Õ¸ñ£©</entry> + </row> + <row> + <entry>byte 8-11</entry> + <entry>int</entry> + <entry>ÿ¸ö×Ö·û¿í¶ÈµÄÏñËØÖµ</entry> + </row> + <row> + <entry>byte 12-15</entry> + <entry>int</entry> + <entry>ÿ¸ö×Ö·û¸ß¶ÈµÄÏñËØÖµ</entry> + </row> + <row> + <entry>byte 16-</entry> + <entry>char</entry> + <entry>×Ö·ûÊý¾ÝµÄÊý×飬ÿ×Ö·ûÖÐÿÏñËØÒ»×Ö½Ú£¬Ò»¹² (nchars*width*height) ×Ö½Ú¡£</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + <para> + <example> + <title>ʹÓà imageloadfont</title> + <programlisting role="php"> +<![CDATA[ +<?php +$im = imagecreatetruecolor(50, 20); +$black = imagecolorallocate($im, 0, 0, 0); +$white = imagecolorallocate($im, 255, 255, 255); +imagefilledrectangle($im, 0, 0, 49, 19, $white); +$font = imageloadfont("04b.gdf"); +imagestring($im, $font, 0, 0, "Hello", $black); +imagepng($im); +?> +]]> + </programlisting> + </example> + </para> + <para> + ²Î¼û <function>imagefontwidth</function> ºÍ + <function>imagefontheight</function>¡£ + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagesetpixel.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/image/functions/imagesetpixel.xml diff -u phpdoc-zh/reference/image/functions/imagesetpixel.xml:1.2 phpdoc-zh/reference/image/functions/imagesetpixel.xml:1.3 --- phpdoc-zh/reference/image/functions/imagesetpixel.xml:1.2 Fri Jul 15 11:48:45 2005 +++ phpdoc-zh/reference/image/functions/imagesetpixel.xml Sun Sep 4 03:34:49 2005 @@ -1,33 +1,33 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> - <refentry id="function.imagesetpixel"> - <refnamediv> - <refname>imagesetpixel</refname> - <refpurpose>»Ò»¸öµ¥Ò»ÏñËØ</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>imagesetpixel</methodname> - <methodparam><type>resource</type><parameter>image</parameter></methodparam> - <methodparam><type>int</type><parameter>x</parameter></methodparam> - <methodparam><type>int</type><parameter>y</parameter></methodparam> - <methodparam><type>int</type><parameter>color</parameter></methodparam> - </methodsynopsis> - <para> - <function>imagesetpixel</function> ÔÚ <parameter>image</parameter> - ͼÏñÖÐÓà <parameter>color</parameter> - ÑÕÉ«ÔÚ <parameter>x</parameter>, <parameter>y</parameter> ×ø±ê£¨Í¼Ïñ×óÉϽÇΪ - 0, 0£©Éϻһ¸öµã¡£ - </para> - <para> - ²Î¼û <function>imagecreate</function> ºÍ - <function>imagecolorallocate</function>¡£ - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.imagesetpixel"> + <refnamediv> + <refname>imagesetpixel</refname> + <refpurpose>»Ò»¸öµ¥Ò»ÏñËØ</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagesetpixel</methodname> + <methodparam><type>resource</type><parameter>image</parameter></methodparam> + <methodparam><type>int</type><parameter>x</parameter></methodparam> + <methodparam><type>int</type><parameter>y</parameter></methodparam> + <methodparam><type>int</type><parameter>color</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagesetpixel</function> ÔÚ <parameter>image</parameter> + ͼÏñÖÐÓà <parameter>color</parameter> + ÑÕÉ«ÔÚ <parameter>x</parameter>£¬<parameter>y</parameter> ×ø±ê£¨Í¼Ïñ×óÉϽÇΪ + 0£¬0£©Éϻһ¸öµã¡£ + </para> + <para> + ²Î¼û <function>imagecreatetruecolor</function> ºÍ + <function>imagecolorallocate</function>¡£ + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/image/functions/imagewbmp.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/image/functions/imagewbmp.xml diff -u phpdoc-zh/reference/image/functions/imagewbmp.xml:1.2 phpdoc-zh/reference/image/functions/imagewbmp.xml:1.3 --- phpdoc-zh/reference/image/functions/imagewbmp.xml:1.2 Fri Jul 15 11:48:46 2005 +++ phpdoc-zh/reference/image/functions/imagewbmp.xml Sun Sep 4 03:34:49 2005 @@ -1,46 +1,46 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.imagewbmp"> - <refnamediv> - <refname>imagewbmp</refname> - <refpurpose>ÒÔ WBMP ¸ñʽ½«Í¼ÏñÊä³öµ½ä¯ÀÀÆ÷»òÎļþ</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>imagewbmp</methodname> - <methodparam><type>resource</type><parameter>image</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>foreground</parameter></methodparam> - </methodsynopsis> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<refentry id="function.imagewbmp"> + <refnamediv> + <refname>imagewbmp</refname> + <refpurpose>ÒÔ WBMP ¸ñʽ½«Í¼ÏñÊä³öµ½ä¯ÀÀÆ÷»òÎļþ</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>bool</type><methodname>imagewbmp</methodname> + <methodparam><type>resource</type><parameter>image</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>foreground</parameter></methodparam> + </methodsynopsis> + <para> + <function>imagewbmp</function> ´Ó + <parameter>image</parameter> ͼÏñ´´½¨Ò»¸öÃûΪ <parameter>filename</parameter> µÄ + <acronym>WBMP</acronym> Îļþ¡£<parameter>image</parameter> + ²ÎÊýÊÇ <function>imagecreatetruecolor</function> µÄ·µ»ØÖµ¡£ + </para> + <para> + <parameter>filename</parameter> ²ÎÊýÊÇ¿ÉÑ¡ÏÈç¹ûÊ¡ÂÔ£¬ÔòÖ±½Ó½«ÔͼÏñÁ÷Êä³ö¡£Í¨¹ýÓà + <function>header</function> ·¢ËÍ <acronym>image/vnd.wap.wbmp</acronym> + µÄ Content-type£¬¿ÉÒÔ´´½¨Ö±½ÓÊä³ö WBMP ͼÏñµÄ PHP ½Å±¾¡£ + <note> <para> - <function>imagewbmp</function> ´Ó - <parameter>image</parameter> ͼÏñ´´½¨Ò»¸öÃûΪ <parameter>filename</parameter> µÄ - <acronym>WBMP</acronym> Îļþ¡£<parameter>image</parameter> - ²ÎÊýÊÇ <function>imagecreate</function> µÄ·µ»ØÖµ¡£ + WBMP Ö§³Ö½öÄÜÓÃÓÚ PHP ±àÒëʱ¼ÓÈëÁË GD-1.8 »ò¸ü¸ß°æ±¾Ê±¡£ </para> - <para> - <parameter>filename</parameter> ²ÎÊýÊÇ¿ÉÑ¡ÏÈç¹ûÊ¡ÂÔ£¬ÔòÖ±½Ó½«ÔͼÏñÁ÷Êä³ö¡£Í¨¹ýÓà - <function>header</function> ·¢ËÍ <acronym>image/vnd.wap.wbmp</acronym> - µÄ Content-type£¬¿ÉÒÔ´´½¨Ö±½ÓÊä³ö WBMP ͼÏñµÄ PHP ½Å±¾¡£ - <note> - <para> - WBMP Ö§³Ö½öÄÜÓÃÓÚ PHP ±àÒëʱ¼ÓÈëÁË GD-1.8 »ò¸ü¸ß°æ±¾Ê±¡£ - </para> - </note> - </para> - <para> - ÓÿÉÑ¡µÄ <parameter>foreground</parameter> ²ÎÊý¿ÉÒÔÉ趨ǰ¾°É«£¬Óà - <function>imagecolorallocate</function> º¯Êý·µ»ØµÄÑÕÉ«±êʶ·û¡£Ä¬ÈÏǰ¾°É«ÊǺÚÉ«¡£ - </para> - <para> - ²Î¼û <function>image2wbmp</function>£¬<function>imagepng</function>£¬<function>imagegif</function>£¬<function>imagejpeg</function> - ºÍ <function>imagetypes</function>¡£ - </para> - </refsect1> - </refentry> + </note> + </para> + <para> + ÓÿÉÑ¡µÄ <parameter>foreground</parameter> ²ÎÊý¿ÉÒÔÉ趨ǰ¾°É«£¬Óà + <function>imagecolorallocate</function> º¯Êý·µ»ØµÄÑÕÉ«±êʶ·û¡£Ä¬ÈÏǰ¾°É«ÊǺÚÉ«¡£ + </para> + <para> + ²Î¼û <function>image2wbmp</function>£¬<function>imagepng</function>£¬<function>imagegif</function>£¬<function>imagejpeg</function> + ºÍ <function>imagetypes</function>¡£ + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: