I want to draw a line.
I would love to be able to give two points on a web page and have it draw a line between the two. Any ideas?
I guess I could set down a bunch of 1x1 DIVs.
Printable View
I want to draw a line.
I would love to be able to give two points on a web page and have it draw a line between the two. Any ideas?
I guess I could set down a bunch of 1x1 DIVs.
I'm sorry, you aren't allowed to do that.
Yes, you can make 1x1 divs, but aside from using tremendous amounts of browser memory, you also have to determine the placement of each pixel from point a to point b, which is a little tedious.
If you are serious about doing this, I would write a C program that runs on the server side that uses the free gd graphics library. Gd allows you to create an image on the fly. Initial versions of gd allowed you to create a gif, but that went away when the patent holders of the LZW compression that gif uses started demanding $.10 per gif.
So now, gd allows you to create a png file that most browsers can display.
No, you don't have to write this in C, you can probably write it in other interpreted languages if you can find a suitable image generation library to generate the final image, it's just that your C program will run more efficiently than interpreted languages.
If you are wanting to do this in VB, take a look at a shareware package called ShotGraph.
cudabean
Well, to give you some history:
My clients product (written in VB) has a web-based end-user interface. The administrator sets up some system monitors, and as they monitor, they generate JPegs. These images are included in the web dashboard, so end-users can see the status of the system.
Using images underminds accesibility (and slows downloads). The images are really just colored boxes connected by colored lines. I can reproduce the boxes with HTML with few problems. But I can't make the lines.
if they are not diagonal you could just use tables
They can be diagonal.
perhaps you could use flash?