PHP实现的功能是显示8条基色色带!
Jun 21, 2016 am 09:12 AM显示
由于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
*/
?>
|
|
|
|
|
|
|
|

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solution: Your organization requires you to change your PIN

How to adjust window border settings on Windows 11: Change color and size

How to enable or disable taskbar thumbnail previews on Windows 11

How to change title bar color on Windows 11?

OOBELANGUAGE Error Problems in Windows 11/10 Repair

What are the differences between Huawei GT3 Pro and GT4?

10 Ways to Adjust Brightness on Windows 11
