I had an image created by using PHP code in which the x and y values in the code interpret the points on the image. I would like to perform mouse click event on that image such that any click on that image who add an point to that and should store in the database. Is it possible? If possible which method should I use? Can you describe?
Here goes my php image creation code:
<?php
include('ag_fetching.php');
header("Content-type: image/png");
$image = imagecreatetruecolor(800, 800);
$red = imagecolorallocate($image, 250, 0, 0);
for($i=0;$i<$count;$i++)
{
imagefilledellipse($image, $a[$i], $b[$i], 10, 10, $red);
}
imagepng($image,'ag_graph.png');
?>
Here $a[$i],$b[$i] are arrays stored with X an Y coordinates of points to be created on image and are stored in database.So ,inclusion of "ag_fetching.php" file is for that purpose.
Using the code above I create an image with background color as black and points on that as red. Can I add points by mouse clicks such that points are to be recorded in a desired database?
You can capture the pixel the mouse was on when the click event fires in JavaScript. Does that put you on the right track?
EDIT Further Code Added