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

211 lines
6.9 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.imagefilledarc" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagefilledarc</refname>
<refpurpose>Рисование и заливка дуги</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imagefilledarc</methodname>
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
<methodparam><type>int</type><parameter>center_x</parameter></methodparam>
<methodparam><type>int</type><parameter>center_y</parameter></methodparam>
<methodparam><type>int</type><parameter>width</parameter></methodparam>
<methodparam><type>int</type><parameter>height</parameter></methodparam>
<methodparam><type>int</type><parameter>start_angle</parameter></methodparam>
<methodparam><type>int</type><parameter>end_angle</parameter></methodparam>
<methodparam><type>int</type><parameter>color</parameter></methodparam>
<methodparam><type>int</type><parameter>style</parameter></methodparam>
</methodsynopsis>
<para>
Рисует дугу с центром в заданных координатах изображения
<parameter>image</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
<varlistentry>
<term><parameter>center_x</parameter></term>
<listitem>
<para>
x-координата центра.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>center_y</parameter></term>
<listitem>
<para>
y-координата центра.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>width</parameter></term>
<listitem>
<para>
Ширина дуги.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>height</parameter></term>
<listitem>
<para>
Высота дуги.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>start_angle</parameter></term>
<listitem>
<para>
Угол начала дуги в градусах.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>end_angle</parameter></term>
<listitem>
<para>
Угол окончания дуги в градусах. 0° соответствует положению 3-часа.
Дуга рисуется по часовой стрелке.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>color</parameter></term>
<listitem>
<para>
&gd.identifier.color;
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>style</parameter></term>
<listitem>
<para>
Битовое или следующих констант:
<orderedlist>
<listitem><simpara><constant>IMG_ARC_PIE</constant></simpara></listitem>
<listitem><simpara><constant>IMG_ARC_CHORD</constant></simpara></listitem>
<listitem><simpara><constant>IMG_ARC_NOFILL</constant></simpara></listitem>
<listitem><simpara><constant>IMG_ARC_EDGED</constant></simpara></listitem>
</orderedlist>
<constant>IMG_ARC_PIE</constant> и <constant>IMG_ARC_CHORD</constant>
взаимно исключающие; <constant>IMG_ARC_CHORD</constant> просто соединяет
начало и конец дуги прямой линией; <constant>IMG_ARC_PIE</constant>
рисует между ними часть окружности.
<constant>IMG_ARC_NOFILL</constant> означает, что должны быть только границы,
заливка не требуется. <constant>IMG_ARC_EDGED</constant>, если используется
вместе с <constant>IMG_ARC_NOFILL</constant>, означает, что начало и конец
дуги соединяются с центром - это хороший способ (лучше чем заливка) получить
сектор (кусок пирога).
</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
// создание изображения
$image = imagecreatetruecolor(100, 100);
// определение цветов
$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
$darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90);
$navy = imagecolorallocate($image, 0x00, 0x00, 0x80);
$darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50);
$red = imagecolorallocate($image, 0xFF, 0x00, 0x00);
$darkred = imagecolorallocate($image, 0x90, 0x00, 0x00);
// делаем эффект 3Д
for ($i = 60; $i > 50; $i--) {
imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE);
imagefilledarc($image, 50, $i, 100, 50, 45, 75 , $darkgray, IMG_ARC_PIE);
imagefilledarc($image, 50, $i, 100, 50, 75, 360 , $darkred, IMG_ARC_PIE);
}
imagefilledarc($image, 50, 50, 100, 50, 0, 45, $navy, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 45, 75 , $gray, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 75, 360 , $red, IMG_ARC_PIE);
// вывод изображения
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Вывод примера : Создание трёхмерного пирога</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imagefilledarc.png"/>
</imageobject>
</mediaobject>
</example>
</para>
</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
-->