Date
May. 19th, 2024
 
2024年 4月 12日

Post: PHP Primer 024 : 图像处理(二)

PHP Primer 024 : 图像处理(二)

Published 12:02 Feb 02, 2012.

Created by @ezra. Categorized in #Programming, and tagged as #PHP.

Source format: Markdown

Table of Content

上一篇学会了线条的绘制,这一篇来了解一下如何绘制文字。

画布与颜色

依然要创建画布和颜色:

<?php
$img=imagecreatetruecolor(100, 100);
$red = imagecolorallocate($img, 0xFF, 0x00, 0x00);

绘制文字

imagestring($img, 5, 0, 0, "Hello, world", $red);

输出图片释放内存

header("content-type: image/png");
imagepng($img);
imagedestroy($img);
?>
Pinned Message
HOTODOGO
I'm looking for a SOFTWARE PROJECT DIRECTOR / SOFTWARE R&D DIRECTOR position in a fresh and dynamic company. I would like to gain the right experience and extend my skills while working in great teams and big projects.
Feel free to contact me.
For more information, please view online résumé or download PDF
本人正在寻求任职 软件项目经理 / 软件技术经理 岗位的机会, 希望加⼊某个新鲜⽽充满活⼒的公司。
如有意向请随时 与我联系
更多信息请 查阅在线简历下载 PDF