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

163 lines
5.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: tmn Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.imagefilltoborder" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagefilltoborder</refname>
<refpurpose>Заливка цветом</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imagefilltoborder</methodname>
<methodparam><type>GdImage</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>border_color</parameter></methodparam>
<methodparam><type>int</type><parameter>color</parameter></methodparam>
</methodsynopsis>
<para>
<function>imagefilltoborder</function> производит заливку области, ограниченной
цветом <parameter>border_color</parameter>. Начальная координата
<parameter>x</parameter>, <parameter>y</parameter> (левый верхний угол имеет
координаты 0, 0), а область закрашивается цветом
<parameter>color</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
<varlistentry>
<term><parameter>x</parameter></term>
<listitem>
<para>
x-координата начала.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>y</parameter></term>
<listitem>
<para>
y-координата начала.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>border_color</parameter></term>
<listitem>
<para>
Цвет границы заливки. &gd.identifier.color;
</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>Закрашивание эллипса</title>
<programlisting role="php">
<![CDATA[
<?php
// создание изображения, установка белого фона
$im = imagecreatetruecolor(100, 100);
imagefilledrectangle($im, 0, 0, 100, 100, imagecolorallocate($im, 255, 255, 255));
// рисование эллипса закрашенного черным цветом
imageellipse($im, 50, 50, 50, 50, imagecolorallocate($im, 0, 0, 0));
// установка цвета границы заливки
$border = imagecolorallocate($im, 0, 0, 0);
$fill = imagecolorallocate($im, 255, 0, 0);
// заливка области
imagefilltoborder($im, 50, 50, $border, $fill);
// вывод и освобождение памяти
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Вывод примера: Закрашивание эллипса</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imagefilltoborder.png"/>
</imageobject>
</mediaobject>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<simpara>
Алгоритм не запоминает явно, какие пиксели уже
были установлены, а скорее делает вывод по цвету пикселя,
поэтому он не может отличить только что установленные пиксели
от пикселей, которые уже есть. Это означает, что выбор любого цвета заливки,
который уже используется в изображении, может привести к нежелательным результатам.
</simpara>
</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
-->