1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
$size = 300; $image=imagecreatetruecolor($size+200, $size+400);
$back = imagecolorallocate($image, 255, 255, 255); $border = imagecolorallocate($image, 0, 0, 0); imagefilledrectangle($image, 0, 0, $size + 150, $size + 100, $back); imagerectangle($image, 0, 0, $size +150, $size + 100, $border);
$yellow_x = 200; $yellow_y = 175; $radius = 250;
$yellow = imagecolorallocatealpha($image, 255, 255, 0, 75); $text_color = imagecolorallocate($image, 233, 14, 91);
imagefilledellipse($image, $yellow_x, $yellow_y, $radius, $radius, $yellow);
imagestring($image, 5, 150, 150, "hello world", $text_color);
header('Content-type: image/png');
imagepng($image); imagedestroy($image);
|