note 123818 added to function.imagestring
| From: | wheberson dot com dot br at gmail dot com | Date: | Thu, 02 May 2019 17:55:13 +0000 |
| Subject: | note 123818 added to function.imagestring | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-210888@lists.php.net to get a copy of this message | ||
// Convert e-mail to image (png)
function convertEmailToImg ($aValue, $aRed, $aGreen, $aBlue, $aAlphaF=0, $aAlphaB=127, $aFontSize=4)
{
$img= imagecreatetruecolor (imagefontwidth ($aFontSize) * strlen ($aValue), imagefontheight
($aFontSize));
imagesavealpha ($img, true);
imagefill ($img, 0, 0, imagecolorallocatealpha ($img, 0, 0, 0, $aAlphaB));
imagestring ($img, $aFontSize, 0, 0, $aValue, imagecolorallocatealpha ($img, $aRed, $aGreen,
$aBlue, $aAlphaF));
ob_start ();
imagepng ($img);
imagedestroy ($img);
return base64_encode (ob_get_clean ());
}
// Example
$imgString= convertEmailToImg ('contact@example.com', 0, 0, 255, 0, 127, 4);
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.34 (proxied: 201.54.221.210)
----
Manual Page -- http://php.net/manual/en/function.imagestring.php
Edit -- https://master.php.net/note/edit/123818
Del: integrated -- https://master.php.net/note/delete/123818/integrated
Del: useless -- https://master.php.net/note/delete/123818/useless
Del: bad code -- https://master.php.net/note/delete/123818/bad+code
Del: spam -- https://master.php.net/note/delete/123818/spam
Del: non-english -- https://master.php.net/note/delete/123818/non-english
Del: in docs -- https://master.php.net/note/delete/123818/in+docs
Del: other reasons-- https://master.php.net/note/delete/123818
Reject -- https://master.php.net/note/reject/123818
Search -- https://master.php.net/manage/user-notes.php