(PECL imagick 2, PECL imagick 3)
Imagick::frameImage — 添加模拟三维边框
$matte_color,$width,$height,$inner_bevel,$outer_bevel在图像周围添加模拟三维边框。宽度和高度指定框架垂直和水平边的边框宽度。内侧和外侧斜角指示框架内侧和外侧阴影的宽度。
matte_colorImagickPixel 对象或表示遮罩颜色的字符串
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();
}
?>