Guest User

Untitled

a guest
Jan 15th, 2019
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $firstDrawing = ImageCreate(400, 400);
  3.  
  4. $black = ImageColorAllocate($firstDrawing, 0, 0, 0);
  5.  
  6. $white = ImageColorAllocate($firstDrawing, 255, 255, 255);
  7.  
  8. $red = ImageColorAllocate($firstDrawing, 255, 0, 0);
  9.  
  10. $green = ImageColorAllocate($firstDrawing, 0, 255, 0);
  11.  
  12. $blue = ImageColorAllocate($firstDrawing, 0, 0, 255);
  13.  
  14. ImageRectangle($firstDrawing, 15, 15, 55, 85, $red);
  15.  
  16. ImageRectangle($firstDrawing, 55, 85, 125, 135, $white);
  17.  
  18. ImageEllipse($firstDrawing, 200, 200, 125, 135, $green);
  19.  
  20. header("Content-type: image/png");
  21.  
  22. ImagePNG($firstDrawing);
  23.  
  24. ImageDestroy($firstDrawing);
  25. ?>
  26.  
  27. error_reporting(E_ALL);
  28. if (extension_loaded('gd') && function_exists('gd_info')) {
  29.  
  30. $firstDrawing = ImageCreate(400, 400);
  31. $black = ImageColorAllocate($firstDrawing, 0, 0, 0);
  32. $white = ImageColorAllocate($firstDrawing, 255, 255, 255);
  33. $red = ImageColorAllocate($firstDrawing, 255, 0, 0);
  34. $green = ImageColorAllocate($firstDrawing, 0, 255, 0);
  35. $blue = ImageColorAllocate($firstDrawing, 0, 0, 255);
  36. ImageRectangle($firstDrawing, 15, 15, 55, 85, $red);
  37. ImageRectangle($firstDrawing, 55, 85, 125, 135, $white);
  38. ImageEllipse($firstDrawing, 200, 200, 125, 135, $green);
  39. header("Content-type: image/png");
  40. ImagePNG($firstDrawing);
  41. ImageDestroy($firstDrawing);
  42. } else {
  43. trigger_error("GD Not installed ");
  44. }
RAW Paste Data