PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

Imagick::getSize - Returns the size associated with the Imagick object | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

Imagick::getSize

(PECL imagick 2.0.0)

Imagick::getSizeReturns the size associated with the Imagick object

説明

array Imagick::getSize ( void )

Get the size in pixels associated with the Imagick object, previously set by Imagick::setSize().

注意:

This method just returns the size that was set using Imagick::setSize(). If you want to get the actual width / height of the image, use Imagick::getImageWidth() and Imagick::getImageHeight().

返り値

Returns the size associated with the Imagick object as an array with the keys "columns" and "rows".

例1 Getting the size of a raw RGB image set at 200x400, after scaling to 400x800 (compared to width / height)

<?php
//Set size first and then load the raw image
$img = new Imagick();
$img->setSize(200400);
$img->readImage("image.rgb");

$img->scaleImage(400800);

$size $img->getSize();
print_r($size);

echo 
"$img->getImageWidth()."x".$img->getImageHeight();
?>

上の例の出力は以下となります。

Array
(
    [columns] => 200
    [rows] => 400
)
400x800


忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「Imagick::getSize - Returns the size associated with the Imagick object」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | Imagick::getSize - Returns the size associated with the Imagick object」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: