(PECL imagick 2, PECL imagick 3)
Imagick::frameImage — 新增模擬 3D 邊框
$matte_color
,$width
,$height
,$inner_bevel
,$outer_bevel
在影像周圍加上一個模擬的立體邊框。寬度和高度指定邊框垂直和水平方向的寬度。內斜角和外斜角表示邊框內外陰影的寬度。
matte_color
ImagickPixel 物件或代表遮罩顏色的字串
width
邊框的寬度
height
邊框的高度
inner_bevel
內斜角寬度
outer_bevel
外斜角寬度
成功時返回 true
。
發生錯誤時拋出 ImagickException。
版本 | 說明 |
---|---|
PECL imagick 2.1.0 | 現在允許使用代表顏色的字串作為第一個參數。以前的版本只允許使用 ImagickPixel 物件。 |
範例 #1 Imagick::frameImage()
<?php
function frameImage($imagePath, $color, $width, $height, $innerBevel, $outerBevel) {
$imagick = new \Imagick(realpath($imagePath));
$width = $width + $innerBevel + $outerBevel;
$height = $height + $innerBevel + $outerBevel;
$imagick->frameimage(
$color,
$width,
$height,
$innerBevel,
$outerBevel
);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>