# Overlaying Lines on an image

**URL:** <https://www.ruby-forum.com/t/overlaying-lines-on-an-image/123984>\
**Category:** Rails\
**Created:** [December 23, 2007, 3:11am UTC](https://www.ruby-forum.com/t/overlaying-lines-on-an-image/123984 "2007-12-23T03:11:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [December 23, 2007, 3:11am UTC](https://www.ruby-forum.com/t/overlaying-lines-on-an-image/123984/1 "2007-12-23T03:11:07Z")

</div>

I am developing a project where users will need to be able to click on  
an image map to choose a path between several different places on the  
image. For example they click on A, B, C, then D compared to B, C, D,  
A.

I am using an image map to detect where on the image the user clicks and  
storing the click as their response in the format (A,D,B,C). I  
understand all of this.

MY QUESTION IS… is there an easy way to draw lines from point A,B,C  
and D. The lines do not need to do anything but appear on the screen.  
I am trying to make it so the user can see there path as they click  
their way through the image.

I am trying to stay away from custom javascript b/c it doesn’t always  
work they way you want it to in all the different browsers.

Is there an easy or should I say dependable way to do this? Any plugins  
or built in AJAX. I have been searching around but haven’t found  
anything that solves my problem.

Thanks in advance,

Chris

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [December 26, 2007, 7:03pm UTC](https://www.ruby-forum.com/t/overlaying-lines-on-an-image/123984/2 "2007-12-26T19:03:59Z")

</div>

Any ideas? Thanks in advance

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [December 26, 2007, 11:52pm UTC](https://www.ruby-forum.com/t/overlaying-lines-on-an-image/123984/3 "2007-12-26T23:52:03Z")

</div>

On 12/22/07, Chris H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> MY QUESTION IS… is there an easy way to draw lines from point A,B,C  
> and D. The lines do not need to do anything but appear on the screen.

That’d be some javascript then.

> I am trying to make it so the user can see there path as they click  
> their way through the image.

I’d go with rmagick. The lines could be added to the image server  
side so they will look the same everywhere.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [December 26, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/overlaying-lines-on-an-image/123984/4 "2007-12-26T23:55:16Z")

</div>

Thanks a lot Greg, I think thats exactly what I was looking for.
