Mega Code Archive

 
Categories / Php / Graphics
 

Drawing a Square and a string

<?php      header ("Content-type: image/png");          $im = ImageCreate (150, 150);      $grey = ImageColorAllocate ($im, 230, 230, 230); // background color      $black = ImageColorAllocate ($im, 0, 0, 0);          ImageRectangle($im, 40, 40, 140, 140, $black);      ImageString($im, 3, 5, 5, "Figure 18.3: Square", $black);      ImagePng ($im);      ImageDestroy ($im); ?>