Output a GD2 image in PHP

Description

The following code shows how to output a GD2 image.

Example


<?php/*w  w  w .j  ava 2s . c o  m*/
// Create a blank image and add some text
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);

// Output the image
imagegd2($im);

// Free up memory
imagedestroy($im);
?>




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text