- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
<?php
/**
* @author Mr. Roman Dunhill
* @copyright 2009
*/
$map_height = 301;
$map_weight = 518;
$map = imagecreate($map_weight, $map_height);
$grassimg = imagecreatefrompng("images/grass.png");
$grass_height = imagesy($grassimg);
$grass_width = imagesx($grassimg);
$start_point1 = ($map_height / 2) - ($grass_height / 2);
$transparent = imagecolorat($grassimg, 1, 1);
imagecolortransparent($grassimg, $transparent);
for($i = 0; $i < 7; $i++)
{
imagecopy($map, $grassimg, ($grass_width * $i), $start_point1, 0, 0, $grass_width, $grass_height);
}
$start_point2 = ($map_height / 2) - $grass_height;
for($i = 0; $i < 6; $i++)
{
imagecopy($map, $grassimg, (($grass_width * $i) + ($grass_width / 2)), $start_point2, 0, 0, $grass_width, $grass_height);
}
header('Content-Type: image/png');
imagepng($map);
?>