mirror of
https://github.com/php/doc-ja.git
synced 2026-03-25 23:52:16 +01:00
147 lines
4.4 KiB
XML
147 lines
4.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: b90054e3ebc5332d7dbe510d4d9010dff32c66f7 Maintainer: mumumu Status: ready -->
|
|
|
|
<refentry xml:id="function.imageresolution" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>imageresolution</refname>
|
|
<refpurpose>画像の解像度を取得/設定する</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description"><!-- {{{ -->
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>array</type><type>bool</type></type><methodname>imageresolution</methodname>
|
|
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>resolution_x</parameter><initializer>&null;</initializer></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>resolution_y</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>imageresolution</function> 関数は、
|
|
画像の解像度を DPI(dots per inch) 単位で取得/設定します。
|
|
オプションのパラメータが &null; だった場合は、
|
|
現在の解像度を配列で返します。
|
|
<parameter>resolution_x</parameter> だけが &null; でない場合、
|
|
垂直/水平方向の解像度がこの値に設定されます。
|
|
オプションのパラメータが両方指定されると、
|
|
垂直/水平方向の解像度がそれぞれ指定された値に設定されます。
|
|
</para>
|
|
<para>
|
|
この手の情報をサポートしている画像フォーマットを読み書きする場合(現状、PNG と JPEG)に、
|
|
解像度情報はメタ情報としてのみ使われます。画像を描画する操作には一切影響しません。
|
|
新しい画像の解像度は 96DPI です。
|
|
</para>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="parameters"><!-- {{{ -->
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
&gd.image.description;
|
|
<varlistentry>
|
|
<term><parameter>resolution_x</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
水平方向の解像度をDPI単位で指定します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>resolution_y</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
垂直方向の解像度をDPI単位で指定します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="returnvalues"><!-- {{{ -->
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
getter として使う場合、
|
|
水平方向と垂直方向の解像度を成功時には返します。
|
|
&return.falseforfailure;。
|
|
setter として使う場合、
|
|
成功時には &true; を返し、&return.falseforfailure;。
|
|
</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>
|
|
<parameter>resolution_x</parameter> と
|
|
<parameter>resolution_y</parameter> は、nullable になりました。
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples"><!-- {{{ -->
|
|
&reftitle.examples;
|
|
<example xml:id="imageresolution.example.basic"><!-- {{{ -->
|
|
<title>画像の解像度を取得/設定する</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$im = imagecreatetruecolor(100, 100);
|
|
imageresolution($im, 200);
|
|
print_r(imageresolution($im));
|
|
imageresolution($im, 300, 72);
|
|
print_r(imageresolution($im));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[0] => 200
|
|
[1] => 200
|
|
)
|
|
Array
|
|
(
|
|
[0] => 300
|
|
[1] => 72
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example><!-- }}} -->
|
|
</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
|
|
-->
|