首页> 基础笔记 >PHP基础学习 >GD库图像处理 GD库图像处理

GD库在图像中绘制文字

作者:小萝卜 2019-08-23 浏览 751

简介imagestring -- 水平地画一行字符串 ,imagestringup -- 垂直地画一行字符串 ,imagechar -- 水平地画一个字符,imagecharup -- 垂直地画一个字符 

imagestring -- 水平地画一行字符串 
语法:bool imagestring ( resource image, int font, int x, int y, string s, int col )
imagestring() 用 col 颜色将字符串 s 画到 image 所代表的图像的 x,y 坐标处(这是字符串左上角坐标,整幅图像的左上角为 0,0)。如果 font 是 1,2,3,4 或 5,则使用内置字体。 

imagestringup -- 垂直地画一行字符串 
语法:bool imagestringup ( resource image, int font, int x, int y, string s, int col )
imagestring()用 col 颜色将字符串 s 垂直地画到 image 所代表的图像的 x, y 座标处(图像的左上角为 0, 0)。如果 font 是 1,2,3,4 或 5,则使用内置字体。
 
imagechar -- 水平地画一个字符 
语法:bool imagechar ( resource image, int font, int x, int y, string c, int color )
imagechar() 将字符串 c 的第一个字符画在 image 指定的图像中,其左上角位于 x,y(图像左上角为 0, 0),颜色为 color。如果 font 是 1,2,3,4 或 5,则使用内置的字体(更大的数字对应于更大的字体)。 

imagecharup -- 垂直地画一个字符 
语法:bool imagecharup ( resource image, int font, int x, int y, string c, int color )
imagecharup() 将字符 c 垂直地画在 image 指定的图像上,位于 x,y(图像左上角为 0, 0),颜色为 color。如果 font 为 1,2,3,4 或 5,则使用内置的字体。
 
imagettftext -- 用 TrueType 字体向图像写入文本 
语法 :array imagettftext ( resource image, float size, float angle, int x, int y, int color, string fontfile, string text ) 
 

 

 

很赞哦! (0)

文章评论

    高端网站建设