Home Tutorial Php Phpgd PHP GD dashed line

 
 

Share on Google+Share on Google+
PHP GD dashed line
Posted on: November 4, 2009 at 12:00 AM
Advertisement
This example shows how to display dashed line in php gd.

<?php

header("Content-type: image/png");

$width = 350;

$height = 360;

$im = ImageCreateTrueColor($width, $height);

ImageAntiAlias($im, true);

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

ImageFillToBorder($im, 0, 0, $white, $white);

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

ImageLine($im, 10, 10, 250, 300, $black);

ImageDashedLine($im, 30, 10, 280, 300, $black);

ImagePNG($im);

ImageDestroy($im);

?>

After running the program you will get the following output

Advertisement

Related Tags for PHP GD dashed line:


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 4, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com