The function implemented by PHP is to display 8 base color bands

Source: Internet
Author: User
Because php's true color table parameters can only support 256, in order to display 8 colors or more ribbons, I used the parameter transfer method. The specific implementation code is as follows: 1. Generate the transition. php & lt ;? Php ** function: generate ribbon graphics * Programmer: wlxz * Date: 2002-00-00 * Header (& quot; Content-type: image because php's true color table parameters can only support 256, in order to display 8-color or more ribbons, I used the parameter transfer method. The specific implementation code is as follows:

1. program for generating ribbon graphics
Transition. php
/*
* Function: generate a ribbon image
* 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 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 images
View_color.php
/*
* Function:
* Programmer: Xiang Li
* Date: 2002-00-00
*/
?>


 





























                       

  
  

  
  

  
  

  
  

  
  

  
  

  
  

  
  



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.