Getting coordinated of click on an image

Results 1 to 3 of 3

Thread: Getting coordinated of click on an image

  1. #1
    Join Date
    Dec 1969

    Default Getting coordinated of click on an image

    We are using ASPImage to do some server side image manipulation. Is there any way we can display an image in the browser, have the user click somewhere on that image and then get the co-orinates of where they clicked on within the image?? We want to then update the graphic by combining two images together, but only at the point where the user clicked - but I cannot figure out a way to get the co-ordinates of the users click!<BR><BR>Thanks!

  2. #2
    Tony Beard Guest

    Default RE: Getting coordinated of click on an image

    This will pass form variables click.X and click.Y to your form processor (mine is a Cold Fusion template called showXY.cfm). and reflect the horizontal and vertical offset from the upper left pixel of your image:<BR>======================================== ====================<BR><BR>&#060;HTML&#062;<BR>&# 060;HEAD&#062;&#060;/HEAD&#062;<BR><BR>&#060;BODY&#062;<BR><BR>&#060;FO RM ACTION="showXY.cfm" METHOD="POST"&#062;<BR>&#060;INPUT TYPE="Image" NAME="click" SRC="map.jpg" BORDER="0"&#062;<BR>&#060;/FORM&#062;<BR><BR>&#060;/BODY&#062;<BR>&#060;/HTML&#062;<BR><BR>================================ ============================<BR><BR>Hope that helps a bit. Need more? Just ask.<BR><BR>Tony<BR><BR>p.s. I&#039m no pro so please forgive any mistakes.<BR>

  3. #3
    Bruno Santos Guest

    Default RE: Getting coordinated of click on an image

    hi Nathan<BR><BR>well i suppose you do use a &#060;INPUT TYPE=IMAGE&#062; tag inside a form, and want the form target page to know where in the image the user had clicked.<BR>if so, just add a ISMAP parameter to the INPUT tag.<BR>the target page will receive two parameters (querystring or form, depending of the METHOD used in the FORM tag). imagine the NAME of the INPUT is set to "myimg". so, the user clicks on the image at coordinates x=100 y=130, then the target page receives the parameters myimg.x=100 and myimg.y=130 .<BR><BR>hope it helps thee.<BR>Bruno (<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts