note 108353 deleted from function.imagecolorallocate by danbrown
| From: | danbrown@php.net | Date: | Thu, 10 May 2012 17:07:28 +0000 |
| Subject: | note 108353 deleted from function.imagecolorallocate by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187651@lists.php.net to get a copy of this message | ||
Note Submitter: info at mariuszolszowski dot pl
----
Better one I think. <3
<?php
function Grid($Img, $X, $Y, $Width, $Height, $Cols, $Rows, $color)
{
$CellWidth = $Width / $Cols;
$CellHeight = $Height / $Rows;
for($i = 0; $i <= $Cols; $i++)
{
imageline($Img, $X + $i * $CellWidth, $Y, $X + $i * $CellWidth, $Y + $Height, $color);
}
for($i = 0; $i <= $Rows; $i++)
{
imageline($Img, $X, $Y + $i * $CellHeight, $X + $Width, $Y + $i * $CellHeight, $color);
}
}
?>
Greets from Poland.