All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
JS特效:用鼠标事件实现图片的渐显效果_JavaScript技术_编程技术
SQL循序渐进(22)EXISTS,和,ALL_[SQL,Server教程]
ASP.NET,2.0,Web窗体语法指导_[Asp.Net教程]
在c#中如何操作文本文件_[Asp.Net教程]
实现类似Windows资源管理器的DataGrid_[Asp.Net教程]
加快Sql server时间查询速度的办法_[SQL Server教程]
解决AJAX的跨浏览器问题_[Asp.Net教程]
ASP.NET技巧:DataGrid传统分页方式_[Asp.Net教程]
ASP.NET,Forums,页面模型分析_.net资料_编程技术
计算两者相差几个月零几天_[PHP教程]
Reading number is top 10 pictures
西游日记2
Azusa Yamamoto1
China's ambassador to Libya embassy was shock, and the glass is broken in
Li Zongrui hunting video screenshots1
看看什么叫美景
毛俊杰-能量永动机
Take you to walk into the most true north Korea rural1
乳娘帕梅拉安德森2
So beauty, will let you spray blood1
From China fortress sora aoi5
Download software ranking
JSP+Ajax Web development typical examples
Unix video tutorial6
WebService在.NET中的实战应用教学视频 → 第1集
matrix2
jdk1.5
实战黑客不求人
Eclipse-CALMSANNY (second edition)
Proficient in Eclipse
linux安装大全
White deer villiage
归海一刀 published in(发表于) 2014/2/10 6:48:44 Edit(编辑)
PHP实现在图片中添加中文文字_[PHP教程]

PHP实现在图片中添加中文文字_[PHP教程]

PHP实现在图片中添加中文文字_[PHP教程]

/*
注意:需要gd库支持,需要iconv支持(php5已经包含不用加载)
*version 1.0
*@author sanshi(叁石)
*QQ: 35047205
*MSN: sanshi0815@tom.com
*Create 2005/10/20
在图片中添加中文文字
*/
/*
param image 图象资源
param size 字体大小
param angle 字体输出角度
param showX 输出位置x坐标
param showY 输出位置y坐标
param font 字体文件位置
param content 要在图片里显示的内容
*/
class showChinaText
{
var text='你好';
var font='fs.ttf';
var angle=0;
var size=50;
var showX=100;
var showY=100;
function showChinaText(showText='')
{
this->text=!isset(showText)?showText:this->text;
//exit();
this->show();
}
function createText(instring)
{
outstring="";
max=strlen(instring);
for(i=0;i {
h=ord(instring[i]);
if(h>=160 && i {
outstring.="&#".base_convert(bin2hex(iconv("gb2312","ucs-2",substr (instring,i,2))),16,10).";";
i++;
}
else
{
outstring.=instring[i];
}
}
return outstring;
}
function createJpeg()
{}
function show()
{
//输出头内容
Header( "Content-type: image/png");
//建立图象
image = imagecreate(400,300);
//定义颜色
red = ImageColorAllocate(image,255,0,0);
white = ImageColorAllocate(image,255,255,255);
black=ImageColorAllocate(image,0,0,0);
//填充颜色
ImageFilledRectangle(image,0,0,200,200,red);
//显示文字
txt=this->createText(this->text);
//写入文字
imagettftext(image,this->size, this->angle, this->showX, this->showY,white,this->font,txt);
//ImageString(image,5,50,10,txt,white);
//显示图形
imagejpeg(image);
ImageDestroy(image);
}
}
//本类,并没有经过很好的考虑,只是简单的进行了封装,以后有机会,可能跟原来的图片类整合
?>
//使用示例
s = new showChinaText();
?>





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.