显示
            由于PHP的本色表参数只能支持256,为了能实现显示8色或更多的色带,我使用了参数传递的方法来实现。具体实现的代码如下:
1、生成色带图形的程序
transition.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        $fontcol = ImageColorAllocate($im, $i*$x, $i*$y, $i*$z);
        ImageLine($im, $i, 0, $i, 50, $fontcol);
    }
ImagePng($im);
ImageDestroy($im);
?>
2、调用生成多个不同的图形
view_color.php
/*
 *  功能:
 *  程序员:向黎
 * 日期:2002-00-00
 */
?>
| 
 | 
| 
 | 
| 
 | 
| 
 | 
| 
 | 
| 
 | 
| 
 | 
| 
 | 
                        
                        PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号