= $width)) return; if (($y < 0) || ($y >= $height)) return; $current = array_search(array($x,$y),$points); echo "$x,$y "; //array search pixel if ($current === false) { echo "false\n"; //raster.setPixel(fill, x, y); $area[] = array($x,$y); boundary_fill($x+1, $y, $width,$height, $points,$area); boundary_fill($x, $y+1, $width,$height, $points,$area); boundary_fill($x-1, $y, $width,$height, $points,$area); boundary_fill($x, $y-1, $width,$height, $points,$area); }else{ echo "true\n"; } } $im = imagecreatetruecolor(400, 400); $points = circle_midpoint(10,100,50); $color = imagecolorallocate($im, 255, 0, 0); foreach ($points as $pixel){ imagesetpixel($im,$pixel[0],$pixel[1],$color); } boundary_fill(10,100,400,400,$points,$area); foreach ($area as $pixel){ imagesetpixel($im,$pixel[0],$pixel[1],$color); } imagepng($im,'testing.png'); ?>