Imagick::textureImage

テクスチャ画像をタイル状に並べる

説明

Imagick Imagick::textureImage(Imagick $texture_wand)

テクスチャ画像をタイル状に繰り返し並べます。

パラメータ

texture_wand

テクスチャ画像として使用する Imagick オブジェクト

戻り値

テクスチャ画像を繰り返し適用した新しい Imagick オブジェクトを返します。

エラー / 例外

エラー時に ImagickException をスローします。

例1 Imagick::textureImage

<?php
function textureImage($imagePath) {
    
$image = new \Imagick();
    
$image->newImage(640480, new \ImagickPixel('pink'));
    
$image->setImageFormat("jpg");
    
$texture = new \Imagick(realpath($imagePath));
    
$texture->scaleimage($image->getimagewidth() / 4$image->getimageheight() / 4);
    
$image $image->textureImage($texture);
    
header("Content-Type: image/jpg");
    echo 
$image;
}

?>