可能你可以帮助我。 我需要一个函数来绘制_GET或_POST字符串的折线路径,并将生成的图像保存到文件夹中。 例如,我的链接将如下所示:http://img.domain.com/?points = 1,5,-70,300,250,500 ... 如果图像已生成并且未更改 - >从文件夹加载它。否则生成一个新的。php gd函数从数组中绘制折线
我的代码在这里:
if (isset($_POST['points'])) {
$points = $_POST['points'];
$image = imagecreate(200, 200);
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
... polyline path drawing here...?
imageline($image, 10, 10, 10, 190, $black);
header('Content-Type: image/png');
imagepng($image);
imagedestroy($image);
... how to save it to the server?
}
感谢。