mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 13:58:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350828 c90b9560-bf6c-de11-be94-00142212c4b1
172 lines
4.4 KiB
XML
172 lines
4.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.imagedashedline" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>imagedashedline</refname>
|
|
<refpurpose>Draw a dashed line</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>imagedashedline</methodname>
|
|
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>x1</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>y1</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>x2</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>y2</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>color</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function is deprecated. Use combination of
|
|
<function>imagesetstyle</function> and <function>imageline</function>
|
|
instead.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&gd.image.description;
|
|
<varlistentry>
|
|
<term><parameter>x1</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Upper left x coordinate.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>y1</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Upper left y coordinate 0, 0 is the top left corner of the image.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>x2</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Bottom right x coordinate.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>y2</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Bottom right y coordinate.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>color</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The fill color. &gd.identifier.color;
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>imagedashedline</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Create a 100x100 image
|
|
$im = imagecreatetruecolor(100, 100);
|
|
$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
|
|
|
|
// Draw a vertical dashed line
|
|
imagedashedline($im, 50, 25, 50, 75, $white);
|
|
|
|
// Save the image
|
|
imagepng($im, './dashedline.png');
|
|
imagedestroy($im);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<mediaobject>
|
|
<alt>Output of example : imagedashedline()</alt>
|
|
<imageobject>
|
|
<imagedata fileref="en/reference/image/figures/imagedashedline.png"/>
|
|
</imageobject>
|
|
</mediaobject>
|
|
</example>
|
|
<example>
|
|
<title>Alternative to <function>imagedashedline</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Create a 100x100 image
|
|
$im = imagecreatetruecolor(100, 100);
|
|
$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
|
|
|
|
// Define our style: First 4 pixels is white and the
|
|
// next 4 is transparent. This creates the dashed line effect
|
|
$style = Array(
|
|
$white,
|
|
$white,
|
|
$white,
|
|
$white,
|
|
IMG_COLOR_TRANSPARENT,
|
|
IMG_COLOR_TRANSPARENT,
|
|
IMG_COLOR_TRANSPARENT,
|
|
IMG_COLOR_TRANSPARENT
|
|
);
|
|
|
|
imagesetstyle($im, $style);
|
|
|
|
// Draw the dashed line
|
|
imageline($im, 50, 25, 50, 75, IMG_COLOR_STYLED);
|
|
|
|
// Save the image
|
|
imagepng($im, './imageline.png');
|
|
imagedestroy($im);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>imagesetstyle</function></member>
|
|
<member><function>imageline</function></member>
|
|
</simplelist>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- 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:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|