1
0
mirror of https://github.com/php/doc-es.git synced 2026-04-24 07:38:19 +02:00
Files
archived-doc-es/reference/imagick/imagick/setoption.xml
T
Pedro Antonio Gil Rodríguez 8fc9ef5d17 Actualización a la última versión
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@336493 c90b9560-bf6c-de11-be94-00142212c4b1
2015-04-11 17:36:24 +00:00

151 lines
3.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 18dc6d0d465c80989566e19e68e1a9ff43dca9cf Maintainer: seros Status: ready -->
<!-- Reviewed: no Maintainer: seros -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="imagick.setoption">
<refnamediv>
<refname>Imagick::setOption</refname>
<refpurpose>Establece una opción</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>Imagick::setOption</methodname>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Asocia una o más opciones con la varita.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&imagick.return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title> Attempt to reach '$extent' size<function>Imagick::setOption</function></title>
<programlisting role="php">
<![CDATA[
<?php
function renderJPG($extent) {
$imagePath = $this->control->getImagePath();
$imagick = new \Imagick(realpath($imagePath));
$imagick->setImageFormat('jpg');
$imagick->setOption('jpeg:extent', $extent);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>
]]>
</programlisting>
</example>
<example>
<title> <function>Imagick::setOption</function></title>
<programlisting role="php">
<![CDATA[
<?php
function renderPNG($imagePath, $format) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->setImageFormat('png');
$imagick->setOption('png:format', $format);
header("Content-Type: image/png");
echo $imagick->getImageBlob();
}
//Save as 64bit PNG.
renderPNG($imagePath, 'png64');
?>
]]>
</programlisting>
</example>
<example>
<title> <function>Imagick::setOption</function></title>
<programlisting role="php">
<![CDATA[
<?php
function renderCustomBitDepthPNG() {
$imagePath = $this->control->getImagePath();
$imagick = new \Imagick(realpath($imagePath));
$imagick->setImageFormat('png');
$imagick->setOption('png:bit-depth', '16');
$imagick->setOption('png:color-type', 6);
header("Content-Type: image/png");
$crash = true;
if ($crash) {
echo $imagick->getImageBlob();
}
else {
$tempFilename = tempnam('./', 'imagick');
$imagick->writeimage(realpath($tempFilename));
echo file_get_contents($tempFilename);
}
}
?>
]]>
</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
-->