php-doc-en/reference/imagick/imagickdraw/arc.xml
Dan Ackroyd 18dc6d0d46 Added lots of examples to Imagick
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@336315 c90b9560-bf6c-de11-be94-00142212c4b1
2015-04-01 15:11:11 +00:00

152 lines
3.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="imagickdraw.arc">
<refnamediv>
<refname>ImagickDraw::arc</refname>
<refpurpose>Draws an arc</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>ImagickDraw::arc</methodname>
<methodparam><type>float</type><parameter>sx</parameter></methodparam>
<methodparam><type>float</type><parameter>sy</parameter></methodparam>
<methodparam><type>float</type><parameter>ex</parameter></methodparam>
<methodparam><type>float</type><parameter>ey</parameter></methodparam>
<methodparam><type>float</type><parameter>sd</parameter></methodparam>
<methodparam><type>float</type><parameter>ed</parameter></methodparam>
</methodsynopsis>
&warn.undocumented.func;
<para>
Draws an arc falling within a specified bounding rectangle on the image.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>sx</parameter></term>
<listitem>
<para>
Starting x ordinate of bounding rectangle
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>sy</parameter></term>
<listitem>
<para>
starting y ordinate of bounding rectangle
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ex</parameter></term>
<listitem>
<para>
ending x ordinate of bounding rectangle
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ey</parameter></term>
<listitem>
<para>
ending y ordinate of bounding rectangle
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>sd</parameter></term>
<listitem>
<para>
starting degrees of rotation
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ed</parameter></term>
<listitem>
<para>
ending degrees of rotation
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title> <function>ImagickDraw::arc</function></title>
<programlisting role="php">
<![CDATA[
<?php
function arc($strokeColor, $fillColor, $backgroundColor, $startX, $startY, $endX, $endY, $startAngle, $endAngle) {
//Create a ImagickDraw object to draw into.
$draw = new \ImagickDraw();
$draw->setStrokeWidth(1);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->arc($startX, $startY, $endX, $endY, $startAngle, $endAngle);
//Create an image object which the draw commands can be rendered into
$image = new \Imagick();
$image->newImage(IMAGE_WIDTH, IMAGE_HEIGHT, $backgroundColor);
$image->setImageFormat("png");
//Render the draw commands in the ImagickDraw object
//into the image.
$image->drawImage($draw);
//Send the image to the browser
header("Content-Type: image/png");
echo $image->getImageBlob();
}
?>
]]>
</programlisting>
</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
-->