View Full Version : How to draw a line ??
Cyman
10-28-2004, 07:25 AM
How to draw a line from a pt. to another pt. by javascript?
Any idea for that?
function drawLine(x1, y1, x2, y2) {
...
}
joh6nn
10-28-2004, 08:54 AM
can't be done; javascript's only graphic capability is displaying graphic files, like jpegs, gifs, etc. you could plot a number of points between areas, and display an image at each of the points, but that's about it.
check out SVG. that can do wot you want. :p
you could always google to see. try the keywords: "javascript draw lines"
i did, and look wot i found (http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm) - funny that, eh?! :rolleyes:
btw: Walter's library is very cool, but it's also very slow to render. not ideal for websites. SVG would still be best: you can code that via JS too. :D
can't be done;
I would'nt not be so sure... :cool:
Take a look at:
http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
And about SGV
http://www.jenitennison.com/xslt/utilities/svg-example.html
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.