如何用PHP的imagestring()函数在图像上水平绘制超长尾词文本?
- 内容介绍
- 文章标签
- 相关推荐
本文共计140个文字,预计阅读时间需要1分钟。
示例代码如下:
php// 创建图像或空白图像$image=imagecreate(700, 300);
// 设置图像背景颜色$background_color=imagecolorallocate($image, 122, 122, 122);
// 设置图像文字颜色$text_color=imagecolorallocate($image, 255, 255, 255);
例子2<?php // Create the size of the image or blank image $img = imagecreate(700, 300); // Set the background color of the image $background_color = imagecolorallocate($img, 122, 122, 122); // Set the text color of the image $text_color = imagecolorallocate($img, 255, 255, 0); // Function to create an image that contains a string. imagestring($img, 10, 30, 60,"Tutorialspoint:Simply Easy Learning", $text_color); header("Content-Type: image/png"); imagepng($img); imagedestroy($img); ?>输出
本文共计140个文字,预计阅读时间需要1分钟。
示例代码如下:
php// 创建图像或空白图像$image=imagecreate(700, 300);
// 设置图像背景颜色$background_color=imagecolorallocate($image, 122, 122, 122);
// 设置图像文字颜色$text_color=imagecolorallocate($image, 255, 255, 255);
例子2<?php // Create the size of the image or blank image $img = imagecreate(700, 300); // Set the background color of the image $background_color = imagecolorallocate($img, 122, 122, 122); // Set the text color of the image $text_color = imagecolorallocate($img, 255, 255, 0); // Function to create an image that contains a string. imagestring($img, 10, 30, 60,"Tutorialspoint:Simply Easy Learning", $text_color); header("Content-Type: image/png"); imagepng($img); imagedestroy($img); ?>输出

