Imagick::annotateImage
(No version information available, might be only in CVS)
Imagick::annotateImage — 画像にテキストによる注記を加える
説明
bool Imagick::annotateImage
( ImagickDraw $draw_settings
, float $x
, float $y
, float $angle
, string $text
)
警告
この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。
警告
この関数は、 実験的 なものです。この関数の動作・ 名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 この関数は自己責任で使用してください。
テキストによる注記を画像に加えます。
パラメータ
- draw_settings
-
テキスト描画設定を含む ImagickDraw オブジェクト。
- x
-
テキストの左端の水平オフセットをあらわすピクセル数。
- y
-
テキストのベースラインの垂直オフセットをあらわすピクセル数。
- angle
-
テキストを書き出す角度。
- text
-
描画するテキスト。
返り値
成功した場合に TRUE を返します。
例
Example#1 Imagick::annotateImage() の使用法
空の画像にテキスト注記を加えます。
<?php
/* オブジェクトを作成します */
$image = new Imagick();
$draw = new ImagickDraw();
$pixel = new ImagickPixel( 'gray' );
/* 画像を作成します */
$image->newImage(800, 75, $pixel);
/* 黒いテキスト */
$pixel->setColor('black');
/* フォントのプロパティ */
$draw->setFont('Bookman-DemiItalic');
$draw->setFontSize( 30 );
/* テキストの作成 */
$image->annotateImage($draw, 10, 45, 0, 'The quick brown fox jumps over the lazy dog');
/* 画像形式の設定 */
$image->setImageFormat('png');
/* ヘッダをつけて画像の出力 */
header('Content-type: image/png');
echo $image;
?>