note 105712 added to function.imagick-annotateimage
| From: | www dot query at gmail dot com | Date: | Thu, 08 Sep 2011 16:09:34 +0000 |
| Subject: | note 105712 added to function.imagick-annotateimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183036@lists.php.net to get a copy of this message | ||
When wishing to print some text on a photograph and make that text sufficiently contrasting to the
background image, use a 4 byte code for colour and transparency.
It is the same 4 byte code using by the parameter '-undercolor' in ImageMagick's
command lime instruction 'convert'.
The first 3 bytes are the RGB colour code and the fourth byte is the transparency byte.
<?
$picin = new Imagick($pic1);
$picin->scaleimage(800,0);
$height = $picin->getimageheight();
$draw = new ImagickDraw();
$draw->setFillColor('#ffff00');
$draw->setFont('Eurostile');
$draw->setFontSize(21);
$draw->setTextUnderColor('#ff000088');
$picin->annotateImage($draw,40,$height-10,0,"Hallo");
$picin->writeimage($pic6);
?>
The example code produces yellow text on a semi-transparent red background.
$pic1 and $pic6 were previously defined as directory/file strings.
----
Server IP: 69.147.83.197
Probable Submitter: 195.149.57.196
----
Manual Page -- http://www.php.net/manual/en/function.imagick-annotateimage.php
Edit -- https://master.php.net/note/edit/105712
Del: integrated -- https://master.php.net/note/delete/105712/integrated
Del: useless -- https://master.php.net/note/delete/105712/useless
Del: bad code -- https://master.php.net/note/delete/105712/bad+code
Del: spam -- https://master.php.net/note/delete/105712/spam
Del: non-english -- https://master.php.net/note/delete/105712/non-english
Del: in docs -- https://master.php.net/note/delete/105712/in+docs
Del: other reasons-- https://master.php.net/note/delete/105712
Reject -- https://master.php.net/note/reject/105712
Search -- https://master.php.net/manage/user-notes.php