Since PHP's natural color table parameters can only support 256, in order to display 8 or more color bands, I used the parameter passing method. The specific implementation code is as follows:
1. Program to generate ribbon graphics
transition.php
/*
* Function: Generate ribbon graphics
* Programmer: wlxz
* Date: 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. Call to generate multiple different graphics
view_color .php
/*
* Function:
* Programmer: Xiang Li
* Date: 2002-00-00
*/
?> ;
; |
Previous article:Free implementation method of website acceleration PHP buffer_PHP tutorial
Next article:Extract HTML tags_PHP tutorial
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
When adding sublime3 to compile system php, use the PHP toolbox, cmd php -v is useless
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|