Summary


This chapter showed how to create graphics on the server. Being able to create graphics interactively is very powerful for interacting with the user. Here are some of this chapter's salient points:

  • You can create an image in memory with the imagecreate function.

  • To set the background and drawing colors, use the imagecolorallocate function.

  • To indicate to the browser that you're creating an image file, such as a JPEG file, use the header('Content-Type: image/jpeg') function.

  • To actually create the image, use a function such as imagejpeg($image).

  • To embed an image in an HTML document, use an element such as <IMG src="/books/1/265/1/html/2/phpscript.php">.

  • You can draw lines with the imageline function.

  • You can draw rectangles with the imagerectangle function.

  • You can draw ellipses with the imageellipse function.

  • You can draw polygons with the imagepolygon function.

  • You can draw arcs with the imagearc function.

  • You can draw individual pixels with the imagesetpixel function.

  • You can fill in figures with functions such as imagefilledellipse.

  • You can draw text with the imagestring function.

  • You can correct an image's gamma with the imagegammacorrect function.



    Spring Into PHP 5
    Spring Into PHP 5
    ISBN: 0131498622
    EAN: 2147483647
    Year: 2006
    Pages: 254

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net