Olive Branch MS Chamber of Commerce (circa Oct 1999)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

61 lines
1.3 KiB

  1. <?php
  2. header("Content-type: image/gif");
  3. $width = 110;
  4. $height = 24;
  5. $font = 2;
  6. if(!isset($label)) { $label="Click Me!"; }
  7. $image = imagecreate($width,$height);
  8. // set up the image colors
  9. $body = imagecolorallocate($image, 0xCC, 0xCC, 0xCC);
  10. $shadow = imagecolorallocate($image, 0x99, 0x99, 0x99);
  11. $light = imagecolorallocate($image, 0xE0, 0xE0, 0xE0);
  12. $text = imagecolorallocate($image, 0x00, 0x00, 0x00);
  13. // draw button body
  14. imagefilledrectangle($image,
  15. 1,1,
  16. $width-2,$height-2,
  17. $body);
  18. // draw bottom shadow
  19. imageline($image,
  20. 0,$height-1,
  21. $width-1,$height-1,
  22. $shadow);
  23. // draw right shadow
  24. imageline($image,
  25. $width-1,1,
  26. $width-1,$height-1,
  27. $shadow);
  28. // draw top highlight
  29. imageline($image,
  30. 0, 0,
  31. $width-1, 0,
  32. $light);
  33. // draw left highlight
  34. imageline($image,
  35. 0, 0,
  36. 0, $height-2,
  37. $light);
  38. // calculate label size
  39. $labelheight = imagefontheight($font);
  40. $labelwidth = imagefontwidth($font) * strlen($label);
  41. // calculate label position
  42. $labelx = ($width - $labelwidth)/2;
  43. $labely = ($height - $labelheight)/2;
  44. // draw label offset
  45. // imagestring($image,$font,$labelx+1,$labely+1,$label,$shadow);
  46. // draw label
  47. imagestring($image,$font,$labelx,$labely,$label,$text);
  48. // output the image
  49. header("Content-type: image/gif");
  50. imagegif($image);
  51. ?>