I’m willing to create an image with certain text using the following code
<?PHP
header('Content-Type: image/png');
$im = imagecreatetruecolor(320, 80);
$blue = imagecolorallocate($im, 59, 89, 152);
$sky = imagecolorallocate($im, 219, 241, 255);
imagefilledrectangle($im, 0, 0, 399, 79, $sky);
$font = 'arial.ttf';
$text = "Hello world";
imagettftext($im, 15, 0, 10, 20, $blue, $font, $text);
imagepng($im);
imagedestroy($im);
?>
Now the out put will be as following image
this is rectangle

Now
What if i want to made to it a rounded corner
by refer to php manual about function imagefilledrectangle I’ve found a good comment with function said to be able to make it rounded corner
<?
function ImageRectangleWithRoundedCorners(&$im, $x1, $y1, $x2, $y2, $radius, $color)
{
// draw rectangle without corners
imagefilledrectangle($im, $x1+$radius, $y1, $x2-$radius, $y2, $color);
imagefilledrectangle($im, $x1, $y1+$radius, $x2, $y2-$radius, $color);
// draw circled corners
imagefilledellipse($im, $x1+$radius, $y1+$radius, $radius*2, $radius*2, $color);
imagefilledellipse($im, $x2-$radius, $y1+$radius, $radius*2, $radius*2, $color);
imagefilledellipse($im, $x1+$radius, $y2-$radius, $radius*2, $radius*2, $color);
imagefilledellipse($im, $x2-$radius, $y2-$radius, $radius*2, $radius*2, $color);
}
?>
But didn’t mention how to use ! ~ anyhelp
let me try
probably
set this data and try… good luck 🙂