PHP实现的功能是显示8条基色色带
来源:互联网 发布:C语言roll程序 编辑:程序博客网 时间:2024/05/20 00:10
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
1、生成色带图形的程序
transition.PHP
<?PHP
/*
* 功能:生成色带图形
* 程序员:wlxz
* 日期:2002-00-00
*/
Header("Content-type: image/Png");
$im = ImageCreate(255,50);
$bgcolor = ImageColorAllocate($im, 0, 0, 0);
$x = trim($_GET['x']);
$y = trim($_GET['y']);
$z = trim($_GET['z']);
for($i=0;$i<255;$i++){
$fontcol = ImageColorAllocate($im, $i*$x, $i*$y, $i*$z);
ImageLine($im, $i, 0, $i, 50, $fontcol);
}
ImagePng($im);
ImageDestroy($im);
?>
2、调用生成多个不同的图形
view_color.PHP
<?PHP
/*
* 功能:
* 程序员:向黎
* 日期:2002-00-00
*/
?>
<html>
<head>
<title> </title>
<meta name="Author" content="XIANG Li">
</head>
<body>
<table>
<tr>
<td><!--色带1-->
<input type="image" src="./transition.PHP?x=0&y=0&z=0">
</td>
</tr>
<tr>
<td><!--色带2-->
<input type="image" src="./transition.PHP?x=0&y=0&z=1">
</td>
</tr>
<tr>
<td><!--色带3-->
<input type="image" src="./transition.PHP?x=0&y=1&z=0">
</td>
</tr>
<tr>
<td><!--色带4-->
<input type="image" src="./transition.PHP?x=0&y=1&z=1">
</td>
</tr>
<tr>
<td><!--色带5-->
<input type="image" src="./transition.PHP?x=1&y=0&z=0">
</td>
</tr>
<tr>
<td><!--色带6-->
<input type="image" src="./transition.PHP?x=1&y=0&z=1">
</td>
</tr>
<tr>
<td><!--色带7-->
<input type="image" src="./transition.PHP?x=1&y=1&z=0">
</td>
</tr>
<tr>
<td><!--色带8-->
<input type="image" src="./transition.PHP?x=1&y=1&z=1">
</td>
</tr>
</table>
</body>
</html>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
由于PHP的本色表参数只能支持256,为了能实现显示8色或更多的色带,我使用了参数传递的方法来实现。具体实现的代码如下:1、生成色带图形的程序
transition.PHP
<?PHP
/*
* 功能:生成色带图形
* 程序员:wlxz
* 日期:2002-00-00
*/
Header("Content-type: image/Png");
$im = ImageCreate(255,50);
$bgcolor = ImageColorAllocate($im, 0, 0, 0);
$x = trim($_GET['x']);
$y = trim($_GET['y']);
$z = trim($_GET['z']);
for($i=0;$i<255;$i++){
$fontcol = ImageColorAllocate($im, $i*$x, $i*$y, $i*$z);
ImageLine($im, $i, 0, $i, 50, $fontcol);
}
ImagePng($im);
ImageDestroy($im);
?>
2、调用生成多个不同的图形
view_color.PHP
<?PHP
/*
* 功能:
* 程序员:向黎
* 日期:2002-00-00
*/
?>
<html>
<head>
<title> </title>
<meta name="Author" content="XIANG Li">
</head>
<body>
<table>
<tr>
<td><!--色带1-->
<input type="image" src="./transition.PHP?x=0&y=0&z=0">
</td>
</tr>
<tr>
<td><!--色带2-->
<input type="image" src="./transition.PHP?x=0&y=0&z=1">
</td>
</tr>
<tr>
<td><!--色带3-->
<input type="image" src="./transition.PHP?x=0&y=1&z=0">
</td>
</tr>
<tr>
<td><!--色带4-->
<input type="image" src="./transition.PHP?x=0&y=1&z=1">
</td>
</tr>
<tr>
<td><!--色带5-->
<input type="image" src="./transition.PHP?x=1&y=0&z=0">
</td>
</tr>
<tr>
<td><!--色带6-->
<input type="image" src="./transition.PHP?x=1&y=0&z=1">
</td>
</tr>
<tr>
<td><!--色带7-->
<input type="image" src="./transition.PHP?x=1&y=1&z=0">
</td>
</tr>
<tr>
<td><!--色带8-->
<input type="image" src="./transition.PHP?x=1&y=1&z=1">
</td>
</tr>
</table>
</body>
</html>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- PHP实现的功能是显示8条基色色带
- OPENCV实现色带检测
- “六基色” 是真实的存在还是炒作的概念?
- 色带的含义
- php实现分页显示功能
- php 实现 一页显示10条记录
- PHP学习笔记 2009-8-25 实现分页显示功能
- 三基色、三原色的区别
- Material Design主题的基色
- 功能是一个一个字的显示
- 在web客户端实现显示图片原图预览功能 ,采用的是jquery的lightbox_balupton_zh技术
- 通讯录索引条的功能实现
- 工厂模式设计实现读取文本文件和图像的三基色信息
- PHP分页功能的实现
- php如何实现上一页下一页的功能 (不是列表页 是内容页)
- 实现标题条的显示与隐藏
- 实现标题条的显示与隐藏
- PHP实现的网站导航条源代码
- 两个aspx页面间传递引用对象。
- 基于PHP与XML的PDF文档生成技术
- [技巧]DataGird的hyper column的url field 绑定两个字段
- 无限级别菜单的实现
- 客户端脚本对中文的验证(javascript)
- PHP实现的功能是显示8条基色色带
- 我的asp.net网站开发经验,欢迎参加讨论。
- 一个ORACLE分页程序,挺实用的.
- 笑望人生,关于IHttpHandler处理图片
- php,不用COM,生成excel文件
- HTML在线编辑器--服务器控件~~.NET实现~~
- 通过ICQ网关发送手机短信的PHP源程序
- How to Share Session State Between Classic ASP and
- 如何把PHP转成EXE文件