PHP把文本转换成图片
时间:2021-07-01 10:21:17
帮助过:3人阅读
- header("Content-type: image/png");
- $string = $_GET['text'];
- $im = imagecreatefrompng("images/button.png");
- $color = imagecolorallocate($im, 255, 255, 255);
- $px = (imagesx($im) - 7.5 * strlen($string)) / 2;
- $py = 9;
- $fontSize = 1;
- imagestring($im, fontSize, $px, $py, $string, $color);
- imagepng($im);
- imagedestroy($im);
- ?>
|
转换成, PHP