Creating Dynamic Images Using GD

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
busdriver99
Forum Newbie
Posts: 1
Joined: Thu Oct 28, 2010 10:42 pm

Creating Dynamic Images Using GD

Post by busdriver99 »

Hi,
I am trying to create a dynamic image using user coordinates and GD. I want to have a user click on an image, capture the coordinates, and use GD to draw on this image. For example, if I have an image, I would like the user to be able to click on multiple points of the image and connect these points using lines without a hard refresh.

I am having trouble with a couple things:

1) I am able to create an image in GD in a standalone PHP file but unable to pass the image back to the front end to be displayed in my html file. I tried to use AJAX to pass the image from the PHP file but XMLHttpRequest does not seem to have an attribute that would allow for this.

2) I am unsure about how to best capture the coordinates of a user click. I have investigated using an input type=image, but using this method, the coordinates are submitted through a post action that would refresh my page, which I am trying to avoid.


Thanks for your help.
Post Reply