首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

用PHP实现渐变字体输出

整理日期:2007年06月14日 【字体:

今天刚写的,还热乎着呢,代码如下:


<?php
Header("Content-type: image/png");

$txt=$_GET['txt']."(刷新我会变色哦)";
$i=strlen($txt);
$width=16*strlen($txt);
$height=42*(int)($width/500+1);
$im = imagecreate($width,$height);

$background_color=imageColorAllocate($im,223,223,223);
$white=imageColorAllocate($im,255,255,255);
$color1=imageColorAllocate($im,255,128,128);
$red=imageColorAllocate($im,255,0,0);
$color3=imageColorAllocate($im,128,64,64);
$yellow=imageColorAllocate($im,255,255,0);
$color4=imageColorAllocate($im,255,128,0);
$color5=imageColorAllocate($im,128,128,0);
$green=imageColorAllocate($im,0,255,0);
$color6=imageColorAllocate($im,0,128,0);
$blue=imageColorAllocate($im,0,0,255);
$pink=imageColorAllocate($im,255,0,128);
$black=imageColorAllocate($im,0,0,0);

$array=array($color1,$red,$color3,$color4,$color5,$green,$color6,$blue,$pink,$black,$white);

$x=1;
$y=40;
$count=1;

for($t=0;$t<$i;$t++)
{
$temp=rand(0,10);
$color=$array[$temp];

伊图教程网[www.etoow.com]
http://www.etoow.com/html/2007-06/1181852200.html
if (ord($txt[$t]) >= 128)
Tags:
用PHP实现渐变字体输出
'http://www.etoow.com/html/2007-06/1181852200.html
1
 
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved