Php > Graphics
Gradient Image
Gradient Image width, $this->height); $b = hexdec($this->startcol); $c = hexdec($this->endcol); $sr = ($b & 0xFF0000) >> 16; $sg = ($b & 0xFF00) >> 8; $sb = ($b & 0xFF); $er = ($c & 0xFF0000) >> 16; $eg = ($c & 0xFF00) >> 8; $eb = ($c & 0xFF); $r = $er - $sr; $g = $eg - $sg; $b = $eb - $sb; for ($line = 0; $line < $this->height; $line++) { $cRed = (($sr += ($r / $this->height)) < 0) ? (int)0: (int)$sr; $cGreen = (($sg += ($g / $this->height)) < 0) ? (int)0: (int)$sg; $cBlue = (($sb += ($b / $this->height)) < 0) ? (int)0: (int)$sb; $clr[$line] = imagecolorallocate($im, $cRed, $cGreen, $cBlue); imageline($im, 0, $line, ($this->width - 1), $line, $clr[$line]); } imagejpeg($im); } } Header("Content-type: image/jpg"); $img = new grad; if (isset($height)) $img->height = $height; if (isset($width)) $img->width = $width; if (isset($startcol)) $img->startcol = $startcol; if (isset($endcol)) $img->endcol = $endcol; $img->draw(); ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage