FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Image BG





DanielXP
Code:
$image = imagecreate(56, 25);
$bgColor = imagecolorallocate ($image, 255, 255, 255);
$textColor = imagecolorallocate ($image, 0, 0, 0);
$hits = str_pad($hits, $fill, "0", STR_PAD_LEFT);
imagestring ($image, 5, 5, 5, $hits, $textColor);
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);


I found this script as im making a hits counter.

I would like to enter a hex code for my bgcolor instead of '255, 255, 255' (white)

So it can easily be changed.

Thanks
Daniel
MrBlueSky
Prepend the number with 0x:

Code:

$bgColor = imagecolorallocate ($image, 0x3B, 0x2D, 0xE1);
DanielXP
MrBlueSky wrote:
Prepend the number with 0x:

Code:

$bgColor = imagecolorallocate ($image, 0x3B, 0x2D, 0xE1);


Thanks sooo much for your help!
Related topics
Image resizer
Random image for your gallery
Image transparency script
Advanced Rollovers
Replace the art and personal pictures with an image gallery?
Php, mime_content_type() problem
Can some install Image Magick?
Image Processing in C++ by Shirish
Tutorial: Image Rollovers w/ Javascript
PHP Image Upload (MySQL/Folder)
Image Mapping?
Signature Image (PLEASE LOCK)
Stretched Background Image to 100%: help
Background image
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.