©
本文档使用
php.cn手册 发布
(PECL imagick 2.0.0)
Imagick::shadowImage — Simulates an image shadow
$opacity
, float $sigma
, int $x
, int $y
)Simulates an image shadow.
opacity
sigma
x
y
成功时返回 TRUE
。
Example #1 Imagick::shadowImage()
<?php
function shadowImage ( $imagePath ) {
$imagick = new \ Imagick ( realpath ( $imagePath ));
$imagick -> shadowImage ( 0.4 , 10 , 50 , 5 );
header ( "Content-Type: image/jpg" );
echo $imagick -> getImageBlob ();
}
?>
[#1] nilayanand at gmail dot com [2009-07-27 10:43:21]
<?php
$im = new Imagick( 'a.jpg' );
$im->setImageFormat("png");
$im->thumbnailImage( 200, null );
$shadow = $im->clone();
$shadow->setImageBackgroundColor( new ImagickPixel( 'black' ) );
$shadow->shadowImage( 80, 3, 5, 5 );
$shadow->compositeImage( $im, Imagick::COMPOSITE_OVER, 0, 0 );
header( "Content-Type: image/jpeg" );
echo $shadow;
?>