mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
Generated by: php-src/build/gen_stub.php --replace-methodsynopses pecl/imagick/ImagickDraw.stub.php doc-en/reference/imagick
144 lines
3.7 KiB
XML
144 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="imagickdraw.setviewbox" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>ImagickDraw::setViewbox</refname>
|
|
<refpurpose>Sets the overall canvas size</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool</type><methodname>ImagickDraw::setViewbox</methodname>
|
|
<methodparam><type>int</type><parameter>left_x</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>top_y</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>right_x</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>bottom_y</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.undocumented.func;
|
|
<para>
|
|
Sets the overall canvas size to be recorded with the drawing vector data.
|
|
Usually this will be specified using the same size as the canvas image.
|
|
When the vector data is saved to SVG or MVG formats, the viewbox is use to
|
|
specify the size of the canvas image that a viewer will render the vector
|
|
data on.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>left_x</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
left x coordinate
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>top_y</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
left y coordinate
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>right_x</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
right x coordinate
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>bottom_y</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
right y coordinate
|
|
</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::setViewBox</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
function setViewBox($strokeColor, $fillColor, $backgroundColor) {
|
|
|
|
$draw = new \ImagickDraw();
|
|
|
|
$draw->setStrokeColor($strokeColor);
|
|
$draw->setFillColor($fillColor);
|
|
$draw->setStrokeWidth(2);
|
|
$draw->setFontSize(72);
|
|
|
|
/*
|
|
|
|
Sets the overall canvas size to be recorded with the drawing vector data. Usually this will be specified using the same size as the canvas image. When the vector data is saved to SVG or MVG formats, the viewbox is use to specify the size of the canvas image that a viewer will render the vector data on.
|
|
|
|
*/
|
|
|
|
$draw->circle(250, 250, 250, 0);
|
|
$draw->setviewbox(0, 0, 200, 200);
|
|
$draw->circle(125, 250, 250, 250);
|
|
$draw->translate(250, 125);
|
|
$draw->circle(0, 0, 125, 0);
|
|
|
|
|
|
$imagick = new \Imagick();
|
|
$imagick->newImage(500, 500, $backgroundColor);
|
|
$imagick->setImageFormat("png");
|
|
|
|
$imagick->drawImage($draw);
|
|
|
|
header("Content-Type: image/png");
|
|
echo $imagick->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
|
|
-->
|