PHP Conference Japan 2024

ImagickDraw::setTextDecoration

(PECL imagick 2, PECL imagick 3)

ImagickDraw::setTextDecoration指定裝飾

說明

public ImagickDraw::setTextDecoration(int $decoration): bool
警告

此函式目前沒有說明文件;僅提供其參數列表。

指定使用文字註釋時要套用的裝飾。

參數

decoration

DECORATION 常數 (imagick::DECORATION_*) 之一。

回傳值

不回傳任何值。

範例

範例 #1 ImagickDraw::setTextDecoration() 範例

<?php
function setTextDecoration($strokeColor, $fillColor, $backgroundColor, $textDecoration) {

$draw = new \ImagickDraw();

$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->setFontSize(72);
$draw->setTextDecoration($textDecoration);
$draw->annotation(50, 75, "Lorem Ipsum!");

$imagick = new \Imagick();
$imagick->newImage(500, 200, $backgroundColor);
$imagick->setImageFormat("png");
$imagick->drawImage($draw);

header("Content-Type: image/png");
echo
$imagick->getImageBlob();
}

?>

新增註解

使用者貢獻的註解 1 則註解

mark-paspirgilis at web dot de
13 年前
嗨,各位。
我花了半天時間尋找關於如何設定該死的底線的說明文件⋯⋯
現在我自己找到了⋯⋯很開心能夠與大家分享我的新知識。
$decoration 可以是以下這些

1 - 文字將會是正常的
2 - 底線
3 - 上線
4 - 刪除線

此致,
Mark Paspirgilis
To Top