Round rectangle Demo : Round Rectangle : Graphics Image PHP Source Code


PHP Source Code » Graphics Image » Round Rectangle »

 

Round rectangle Demo



<?php
function roundrect($image, $x1, $y1, $x2, $y2, $curvedepth, $color) {
 imageline($image, ($x1 + $curvedepth), $y1, ($x2 - $curvedepth), $y1, $color);
 imageline($image, ($x1 + $curvedepth), $y2, ($x2 - $curvedepth), $y2, $color);
 imageline($image, $x1, ($y1 + $curvedepth), $x1, ($y2 - $curvedepth), $color);
 imageline($image, $x2, ($y1 + $curvedepth), $x2, ($y2 - $curvedepth), $color);
 imagearc($image, ($x1 + $curvedepth)($y1 + $curvedepth)(* $curvedepth)(* $curvedepth)180270, $color);
 imagearc($image, ($x2 - $curvedepth)($y1 + $curvedepth)(* $curvedepth)(* $curvedepth)270360, $color);
 imagearc($image, ($x2 - $curvedepth)($y2 - $curvedepth)(* $curvedepth)(* $curvedepth)090, $color);
 imagearc($image, ($x1 + $curvedepth)($y2 - $curvedepth)(* $curvedepth)(* $curvedepth)90180, $color);
}
$myImage = imagecreate(200,100);
$myGrey = imagecolorallocate($myImage,204,204,204);
$myBlack = imagecolorallocate($myImage,0,0,0);
roundrect($myImage, 20101809020, $myBlack);
header("Content-type: image/png");
imagepng($myImage);
imagedestroy($myImage);
?>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Graphics Image
» Round Rectangle