1
0
mirror of https://github.com/php/doc-ja.git synced 2026-04-26 09:28:10 +02:00
Files
archived-doc-ja/reference/image/functions/imagecreatefromgd2part.xml
T

156 lines
4.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: shimooka,mumumu -->
<refentry xml:id="function.imagecreatefromgd2part" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagecreatefromgd2part</refname>
<refpurpose>GD2 ファイルまたは URL の指定した部分から新規イメージを生成する</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>GdImage</type><type>false</type></type><methodname>imagecreatefromgd2part</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam><type>int</type><parameter>x</parameter></methodparam>
<methodparam><type>int</type><parameter>y</parameter></methodparam>
<methodparam><type>int</type><parameter>width</parameter></methodparam>
<methodparam><type>int</type><parameter>height</parameter></methodparam>
</methodsynopsis>
<para>
GD2 ファイルまたは URL の指定した部分から新規イメージを生成します。
</para>
&tip.fopen-wrapper;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
GD2 画像へのパス。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>x</parameter></term>
<listitem>
<para>
作成元の x 座標。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>y</parameter></term>
<listitem>
<para>
作成元の y 座標。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>width</parameter></term>
<listitem>
<para>&gd.source.width;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>height</parameter></term>
<listitem>
<para>&gd.source.height;</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>&gd.return.identifier;</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
成功時には、
この関数は <classname>GDImage</classname>
クラスのインスタンスを返すようになりました。
これより前のバージョンでは、
<type>resource</type> を返していました。
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>imagecreatefromgd2part</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
// この例では、まず画像のサイズが必要となります
$image = getimagesize('./test.gd2');
// 画像のサイズを取得し、
// 画像のインスタンスを作成します
$im = imagecreatefromgd2part('./test.gd2', 4, 4, ($image[0] / 2) - 6, ($image[1] / 2) - 6);
// 画像処理をします。
// ここでは、エンボス処理を行っています
if(function_exists('imagefilter'))
{
imagefilter($im, IMG_FILTER_EMBOSS);
}
// 最適化した画像を保存します
imagegd2($im, './test_emboss.gd2');
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&gd.deprecated.gd-formats;
</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
-->