Results 1 to 10 of 10

Thread: [RESOLVED] Drawing on an Image

  1. #1

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Resolved [RESOLVED] Drawing on an Image

    I have an image that I will be displaying on a page. I want to be able to first allow the user to click on parts of the image where they want a dot to appear, then I want to take the location of where they placed the dot and store it in a database. Can any one point me in the right direction?

    I currently have a VB6 app where I am able to do this but the powers to be want me to develop a web app that will allow the user to do the same thing.

    Any ideas?
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  2. #2
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: Drawing on an Image

    Won't be easy... You'd likely have to use JavaScript to retrieve the location of the mouse when it's clicked, then do a postback and redraw the image... it'd be slow at best, even with AJAX.

  3. #3

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Drawing on an Image

    I thought so, thanks!
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Drawing on an Image

    If you make the image an image that submits (<input type="image">) then when the form is submitted, you should get an x and y coordinate along with the other parameters. You could use that.

  5. #5

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Drawing on an Image

    Could you show me a brief example and would I be able to display multiple dots?
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  6. #6
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Re: Drawing on an Image

    Could you use javascript to drag and drop actual "dots" on the image?

    At the end of the operation you could capture and add the end coordinates of the dropped image to a hidden control.

    You could have more control over the op

    This works in IE, FF,Safari

    Drag N Drop

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Drawing on an Image

    Put this in a sample .html page, then click on the image

    Code:
    <form method="get" action="receive.aspx">
    <input type="image" src="http://www.vbforums.com/image.php?u=45441&dateline=1201007640" value="test" />
    </form>
    Then look at the URL.

  8. #8

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Drawing on an Image

    Great, thanks!
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Drawing on an Image

    No prob, if that solved things, resolve the thread, else, ask more questions!

  10. #10

    Thread Starter
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Drawing on an Image

    Ok, I am testing the code now. Thanks again!
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


Posting Permissions

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



Click Here to Expand Forum to Full Width