Home Tutorial Php Phpgd PHP GD Outline Text

 
 

Share on Google+Share on Google+
PHP GD Outline Text
Posted on: November 10, 2009 at 12:00 AM
Advertisement
This example shows how to draw an outline text in php gd.

<html>

<body>

<?php

$im = imagecreate(320, 200);

$black = imagecolorallocate($im, 0, 0, 0);

$white = imagecolorallocate($im, 255, 255, 255);

$blue = imagecolorallocate($im, 24, 40, 80);

imagefilledrectangle($im, 0, 0, 319, 199, $white);

imagerectangle($im, 0, 0, 250, 199, $black);

 

imagefilledrectangle($im, 2, 20, 40, 160, $blue);

imagefilledrectangle($im, 42, 60, 80, 160, $blue);

imagefilledrectangle($im, 82, 100, 120, 160, $blue);

imagefilledrectangle($im, 122, 80, 160, 160, $blue);

imagefilledrectangle($im, 162, 10, 200, 160, $blue);

imagefilledrectangle($im, 202, 40, 240, 160, $blue);

 

imagestringup($im, 5, 15, 195, "Op1", $black);

imagestringup($im, 5, 55, 195, "Op2", $black);

imagestringup($im, 5, 95, 195, "Op3", $black);

imagestringup($im, 5, 135, 195, "Op4", $black);

imagestringup($im, 5, 175, 195, "Op5", $black);

imagestringup($im, 5, 215, 195, "Op6", $black);

imagepng($im,'image.png');

imagedestroy($im);

?>

<img src="image.png" width="320" height="200">

</body>

</html>

After running the program you will get the following output

Advertisement

Related Tags for PHP GD Outline Text:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 10, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com