2016年8月4日 星期四

[PHP] imagestring()

imagestring()
imagestring(圖案設定,字體,x坐標,y坐標,字串,字的顏色);
smiley字體是1,2,3,4或5,則使用內置字體。



例子:

$im = imagecreate(100, 30);//圖片的長x寬


$bg = imagecolorallocate($im, 255, 255, 255);//白色背景
$textcolor = imagecolorallocate($im, 0, 0, 255);//蓝色文本

// 把字符串写在图像左上角
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);

// 输出图像
header("Content-type: image/png");
imagepng($im);


來自:http://php.net/manual/en/function.imagestring.php

沒有留言:

張貼留言

影片的問題請留在影片的留言區裡。
部落格不會另外通知給我,所以很難發現你有留言。