Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Drawing a Square in php

Sun Oct 26, 2008 10:52 pm

Code:

<?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);
?>




Post a reply
  Related Posts  to : Drawing a Square in php
 ellipse, circle, rectangle, square, or parallelogram     -  
 Drawing Lines in php     -  
 Drawing a Triangler in php     -  
 Drawing a Polygon in php     -  
 php drawing a circle     -  
 drawing sonic     -  
 Drawing cone using openGL     -  
 Drawing Octahedron using openGL     -  
 Drawing a triangle with colors     -  
 Drawing Torus using OpenGL     -  

Topic Tags

PHP Graphics