line drawing library

A

Andrew Poulos

Is there a small graphics library that I can use? All I need to do is
draw a line of a nominated thickness and colour between two specified
points and to, at some later time, "delete" the line?

I've found a few offerings but either they weren't multi-browser
compatible or they were too big for me to consider (20K instead of 2 or 3K).

Andrew Poulos
 
A

Andrew Poulos

Andrew said:
..excuse me? 20Kb is too much? Exactly who do you need to
feed this to? People in subs, using a hydrophone as a modem?

That sounds like an astoundingly tight size limit for this day
and age. It would not have been considered a tight limit, as
the main functionality of a page, even at the 28Kb modem stage.
Yes you are right, it is a tight size limit. Do you know of a library I
could use?

Andrew Poulos
 
J

Jim Ley

Yes you are right, it is a tight size limit. Do you know of a library I
could use?

HTML is not a vector language, lines aren't lines, but nothing more
than lots of blocks, it's easy to do yourself, no library needed, any
general purpose library will be large.

Jim.
 
R

Randy Webb

Andrew said:
Yes you are right, it is a tight size limit. Do you know of a library I
could use?

Andrew Poulos

http://members.aol.com/hikksnotathome/graphit/index.html

draws a line between two clicked points. It could easily be modified to
draw a line between any two points. But the larger the "box" is, the
larger the page gets. Most of the code in that page (Its 29kb) is CSS
code, not JS code though.

It "works", as written, in Opera and IE. Wouldn't be hard to make it
work in Mozilla with a few corrections. And the entire thing could
probably be made more efficient.

The creation date on the server was April 30, 2003 for the index.html
file but the creation date for the images was in 2002, so I probably
made some minor changes in 2003. Simply click on two places in the blue
box and it will "draw" a red line between them.
 
A

Andrew Poulos

Randy said:
http://members.aol.com/hikksnotathome/graphit/index.html

draws a line between two clicked points. It could easily be modified to
draw a line between any two points. But the larger the "box" is, the
larger the page gets. Most of the code in that page (Its 29kb) is CSS
code, not JS code though.

It "works", as written, in Opera and IE. Wouldn't be hard to make it
work in Mozilla with a few corrections. And the entire thing could
probably be made more efficient.

The creation date on the server was April 30, 2003 for the index.html
file but the creation date for the images was in 2002, so I probably
made some minor changes in 2003. Simply click on two places in the blue
box and it will "draw" a red line between them.

Thanks, I'll have a look at it and post any changes for MZ that I make.

Andrew Poulos
 
R

Robert

Andrew Poulos said:
Is there a small graphics library that I can use? All I need to do is
draw a line of a nominated thickness and colour between two specified
points and to, at some later time, "delete" the line?

I've found a few offerings but either they weren't multi-browser
compatible or they were too big for me to consider (20K instead of 2 or 3K).

This site has examples of dynamically creating and modifing an xbm
image. I do not know much about this. I tried the second example on
the page and it worked for me.

http://developer.irt.org/script/955.htm


Robert
 
R

Richard Cornford

Andrew said:
Is there a small graphics library that I can use? All I
need to do is draw a line of a nominated thickness and
colour between two specified points and to, at some later
time, "delete" the line?
<snip>

You might take a look at the - wz_jsgraphics.js - library at:-

<URL: http://www.walterzorn.com >

(I forget the URL of the exact page)

- it is 15Kb, but you only need the line drawing methods and they are
good implementations of the Bresenham line drawing algorithm (might be
worth a google search as any reference to that algorithm may also
mention faster alternatives), which is very fast. If you can understand
the code it should be possible to reverse-engineer and strip the
specifics down to less than 5Kb.

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top