php-doc-en/reference/imagick/imagickpixel/setcolor.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

106 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="imagickpixel.setcolor">
<refnamediv>
<refname>ImagickPixel::setColor</refname>
<refpurpose>Sets the color</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>ImagickPixel::setColor</methodname>
<methodparam><type>string</type><parameter>color</parameter></methodparam>
</methodsynopsis>
&warn.undocumented.func;
<para>
Sets the color described by the ImagickPixel object, with a string
(e.g. "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc.).
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>color</parameter></term>
<listitem>
<para>
The color definition to use in order to initialise the
ImagickPixel object.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if the specified color was set, &false; otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title> <function>ImagickPixel::setColor</function></title>
<programlisting role="php">
<![CDATA[
<?php
function setColor() {
$draw = new \ImagickDraw();
$strokeColor = new \ImagickPixel('green');
$fillColor = new \ImagickPixel();
$fillColor->setColor('rgba(100%, 75%, 0%, 1.0)');
$draw->setstrokewidth(3.0);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->rectangle(200, 200, 300, 300);
$image = new \Imagick();
$image->newImage(500, 500, "SteelBlue2");
$image->setImageFormat("png");
$image->drawImage($draw);
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
-->