Snippets - Create

Snippets index page

NOTE: Most of the IM snippets have been tested on IM version 6.3.5 There may be some differences if you are using the code on other versions.

Draw using ellipse - Anthony 17/6/2008

Use Ellipse to draw a partial ellipse centered at the given point with the x-axis and y-axis radius and start and end of arc in degrees.

  1. <?php  
  2. $cmd " -size 200x200 xc:none -stroke black -strokewidth 1 "
  3. "-fill pink -draw \"ellipse 100,100 62,94 0,360 \" ".
  4. " -fill red -draw \"ellipse 100,120 25,38 45,135\" ".
  5. " -fill white -draw \"ellipse 75,75 19,28 0,360\" ".
  6. " -draw \"ellipse 125,75 19,28 0,360\" ".
  7. "-fill blue -draw \"ellipse 75,75 10,14 0,360\" ".
  8. "-draw \"ellipse 125,75 10,14 0,360\" "
  9. exec("convert $cmd output.png"); 
  10. ?> 

For more examples and information check out the main Imagemagick section.

Draw concentric circles View

Draw polyline View

Draw rectangle View

Draw using ellipse View