1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-26 00:32:15 +01:00
Files
archived-doc-ru/reference/image/functions/imagedashedline.xml
Sergey Panteleev 6d43fd64d7 Исправление форматирования
[skip-spellcheck]
[skip-lint]
2022-12-27 03:42:36 +03:00

191 lines
5.3 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: tmn Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.imagedashedline" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagedashedline</refname>
<refpurpose>Рисование пунктирной линии</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imagedashedline</methodname>
<methodparam><type>GdImage</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>
Функция устарела. Используйте сочетание функций
<function>imagesetstyle</function> и <function>imageline</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
<varlistentry>
<term><parameter>x1</parameter></term>
<listitem>
<para>
Верхняя левая x-координата.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>y1</parameter></term>
<listitem>
<para>
Верхняя левая y-координата. 0, 0 - верхний левый угол изображения.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>x2</parameter></term>
<listitem>
<para>
Нижняя правая х-координата.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>y2</parameter></term>
<listitem>
<para>
Нижняя правая у-координата.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>color</parameter></term>
<listitem>
<para>
Цвет линии. &gd.identifier.color;
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&gd.changelog.image-param;
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <function>imagedashedline</function></title>
<programlisting role="php">
<![CDATA[
<?php
// Создание изображения 100x100
$im = imagecreatetruecolor(100, 100);
$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
// Рисование вертикальной пунктирной линии
imagedashedline($im, 50, 25, 50, 75, $white);
// Сохранение изображения
imagepng($im, './dashedline.png');
imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Вывод примера: imagedashedline()</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imagedashedline.png"/>
</imageobject>
</mediaobject>
</example>
<example>
<title>Альтернатива функции <function>imagedashedline</function></title>
<programlisting role="php">
<![CDATA[
<?php
// Создание изображения 100x100
$im = imagecreatetruecolor(100, 100);
$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
// Определение стиля: Первые 4 пиксела белые, следующие 4 - прозрачные.
// Это создаёт эффект пунктира.
$style = Array(
$white,
$white,
$white,
$white,
IMG_COLOR_TRANSPARENT,
IMG_COLOR_TRANSPARENT,
IMG_COLOR_TRANSPARENT,
IMG_COLOR_TRANSPARENT
);
imagesetstyle($im, $style);
// Рисование пунктирной линии
imageline($im, 50, 25, 50, 75, IMG_COLOR_STYLED);
// Сохранение изображения
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
-->