1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-24 15:12:22 +01:00
Files
archived-doc-ja/reference/image/functions/imagecreate.xml
2025-08-17 09:10:31 +09:00

141 lines
4.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: shimooka,mumumu -->
<refentry xml:id="function.imagecreate" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagecreate</refname>
<refpurpose>パレットを使用する新規画像を作成する</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>GdImage</type><type>false</type></type><methodname>imagecreate</methodname>
<methodparam><type>int</type><parameter>width</parameter></methodparam>
<methodparam><type>int</type><parameter>height</parameter></methodparam>
</methodsynopsis>
<para>
<function>imagecreate</function> は、
指定した大きさの空の画像を表す画像 ID を返します。
</para>
<para>
一般に、<function>imagecreate</function> よりは
<function>imagecreatetruecolor</function> を使うことを推奨します。
より高品質な画像処理ができるからです。パレット形式の画像を出力したい場合は、
<function>imagepng</function>
<function>imagegif</function> で画像を保存する直前に
<function>imagetruecolortopalette</function> を呼ばなければいけません。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>width</parameter></term>
<listitem>
<para>
画像の幅。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>height</parameter></term>
<listitem>
<para>
画像の高さ。
</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>
新しい GD 画像ストリームの作成および画像の出力
</title>
<programlisting role="php">
<![CDATA[
<?php
header("Content-Type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>出力例 : 新しい GD 画像ストリームの作成および画像の出力</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imagecreate.png"/>
</imageobject>
</mediaobject>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>imagecreatetruecolor</function></member>
</simplelist>
</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
-->