php-doc-en/reference/image/functions/imagecopyresized.xml
Philip Olson 700aa8159f Document behavior explained in bug #21630, read commit for details. This
closes that bug.  Also, imagecreatetruecolor is preferred over imagecreate().


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@112632 c90b9560-bf6c-de11-be94-00142212c4b1
2003-01-19 03:09:48 +00:00

75 lines
3.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/image.xml, last change in rev 1.36 -->
<refentry id="function.imagecopyresized">
<refnamediv>
<refname>imagecopyresized</refname>
<refpurpose>Copy and resize part of an image</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>imagecopyresized</methodname>
<methodparam><type>resource</type><parameter>dst_im</parameter></methodparam>
<methodparam><type>resource</type><parameter>src_im</parameter></methodparam>
<methodparam><type>int</type><parameter>dstX</parameter></methodparam>
<methodparam><type>int</type><parameter>dstY</parameter></methodparam>
<methodparam><type>int</type><parameter>srcX</parameter></methodparam>
<methodparam><type>int</type><parameter>srcY</parameter></methodparam>
<methodparam><type>int</type><parameter>dstW</parameter></methodparam>
<methodparam><type>int</type><parameter>dstH</parameter></methodparam>
<methodparam><type>int</type><parameter>srcW</parameter></methodparam>
<methodparam><type>int</type><parameter>srcH</parameter></methodparam>
</methodsynopsis>
<para>
<function>imagecopyresized</function> copies a rectangular
portion of one image to another image.
<parameter>Dst_im</parameter> is the destination image,
<parameter>src_im</parameter> is the source image identifier. If
the source and destination coordinates and width and heights
differ, appropriate stretching or shrinking of the image fragment
will be performed. The coordinates refer to the upper left
corner. This function can be used to copy regions within the
same image (if <parameter>dst_im</parameter> is the same as
<parameter>src_im</parameter>) but if the regions overlap the
results will be unpredictable.
</para>
<note>
<para>
There is a problem due to palette image limitations (255+1 colors).
Resampling or filtering an image commonly needs more colors than 255, a
kind of approximation is used to calculate the new resampled pixel and its
color. With a palette image we try to allocate a new color, if that
failed, we choose the closest (in theory) computed color. This is
not always the closest visual color. That may produce a weird result, like
blank (or visually blank) images. To skip this problem, please use a
truecolor image as a destination image, such as one created by
<function>imagecreatetruecolor</function>.
</para>
</note>
<para>
See also <function>imagecopyresampled</function>.
</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:"../../../../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
-->