Added documentation for imagesetstyle() and deprecated buggy function

imagedashedline() which is not supported in even GD itself.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@49573 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
foobar 2001-06-12 01:40:57 +00:00
parent 8ce6bd7593
commit 4a880aec9e

View file

@ -1028,9 +1028,7 @@ ImageColorDeAllocate($im, $white);
<note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1 or later</para></note>
</refsect1>
</refentry>
<refentry id="function.imagecreate">
<refnamediv>
<refname>ImageCreate</refname>
@ -1363,14 +1361,9 @@ function LoadWBMP ($imgname) {
</funcprototype>
</funcsynopsis>
<para>
<function>ImageDashedLine</function> draws a dashed line from
<parameter>x1</parameter>, <parameter>y1</parameter> to
<parameter>x2</parameter>, <parameter>y2</parameter> (top left is
0, 0) in image <parameter>im</parameter> of color
<parameter>col</parameter>.
</para>
<para>
See also <function>ImageLine</function>.
This function is deprecated. Use combination of
<function>ImageSetStyle</function> and <function>ImageLine</function>
instead.
</para>
</refsect1>
</refentry>
@ -2442,8 +2435,68 @@ ImageDestroy ($im);
<note><para>This function was added in PHP 4.0.6</para></note>
</refsect1>
</refentry>
<refentry id="function.imagesetstyle">
<refnamediv>
<refname>ImageSetStyle</refname>
<refpurpose>Set the style for line drawing
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>imagesetstyle</function></funcdef>
<paramdef>resource <parameter>im</parameter></paramdef>
<paramdef>array <parameter>style</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
<function>ImageSetStyle</function> sets the style to be used by all
line drawing functions (such as <function>ImageLine</function>
and <function>ImagePolygon</function>) when drawing with the special
color <literal>IMG_COLOR_STYLED</literal> or lines of images with color
<literal>IMG_COLOR_STYLEDBRUSHED</literal>.
</para>
<para>
The <parameter>style</parameter> parameter is an array of pixels.
Following example script draws a dashed line from upper left to
lower right corner of the canvas:
<example>
<title>ImageSetStyle</title>
<programlisting role="php">
&lt;?php
Header ("Content-type: image/png");
$im = imagecreate (100, 100);
$w = ImageColorAllocate ($im, 255, 255, 255);
$red = ImageColorAllocate ($im, 255, 0, 0);
/* Draw a dashed line, 5 red pixels, 5 white pixels */
$style=array($red,$red,$red,$red,$red,$w,$w,$w,$w,$w);
ImageSetStyle($im, $style);
ImageLine($im, 0, 0, 100, 100, IMG_COLOR_STYLED);
/* Draw a line of happy faces using ImageSetBrush() with ImageSetStyle */
$style=array($w,$w,$w,$w,$w,$w,$w,$w,$w,$w,$w,$w,$red);
ImageSetStyle($im, $style);
$brush=ImageCreateFromPng("http://www.libpng.org/pub/png/images/smile.happy.png");
ImageColorTransparent($brush, $w);
ImageSetBrush($im, $brush);
ImageLine($im, 100, 0, 0, 100, IMG_COLOR_STYLEDBRUSHED);
ImagePng($im);
ImageDestroy ($im);
?&gt;
</programlisting>
</example>
</para>
<para>
See also <function>ImageSetBrush</function>, <function>ImageLine</function>.
</para>
<note><para>This function was added in PHP 4.0.6</para></note>
</refsect1>
</refentry>
<refentry id="function.imagesettile">
<refnamediv>
<refname>ImageSetTile</refname>
@ -2478,9 +2531,7 @@ ImageDestroy ($im);
<note><para>This function was added in PHP 4.0.6</para></note>
</refsect1>
</refentry>
<refentry id="function.imagesetthickness">
<refnamediv>
<refname>ImageSetThickness</refname>
@ -2503,8 +2554,7 @@ ImageDestroy ($im);
<note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1 or later</para></note>
</refsect1>
</refentry>
<refentry id="function.imagestring">
<refnamediv>
<refname>ImageString</refname>