<?php
$foo_x=$_POST['foo_x'];
$foo_y=$_POST['foo_y'];
echo "X=$foo_x, Y=$foo_y ";
$img = imagecreatefrompng("test.png");
sscanf(substr($_POST['color'],1), "%2x%2x%2x", $r, $g, $b);
$col = imagecolorallocate ($img, $r,$g,$b);
imagesetpixel($img,$foo_x,$foo_y, $col);
imagepng($img,"test.png");
?>
<form action="" method="post">
<input type="color" src="test.png" name="color" value=<?php echo $_POST['color']?>>
<br>
<input type="image" src="test.png" name="foo">
</form>
|