line drawing library

Discussion in 'Javascript' started by Andrew Poulos, Oct 14, 2004.

  1. 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
    Andrew Poulos, Oct 14, 2004
    #1
    1. Advertising

  2. Andrew Thompson wrote:
    > On Thu, 14 Oct 2004 23:26:05 +1000, Andrew Poulos wrote:
    >
    >
    >>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).

    >
    >
    > ..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
    Andrew Poulos, Oct 14, 2004
    #2
    1. Advertising

  3. Andrew Poulos

    Jim Ley Guest

    On Fri, 15 Oct 2004 08:23:57 +1000, Andrew Poulos
    <> wrote:

    >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.
    Jim Ley, Oct 14, 2004
    #3
  4. Andrew Poulos

    Randy Webb Guest

    Andrew Poulos wrote:

    > Andrew Thompson wrote:
    >
    >> On Thu, 14 Oct 2004 23:26:05 +1000, Andrew Poulos wrote:
    >>
    >>
    >>> 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).

    >>
    >>
    >>
    >> ..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


    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.


    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 15, 2004
    #4
  5. Randy Webb wrote:

    > Andrew Poulos wrote:
    >
    >> Andrew Thompson wrote:
    >>
    >>> On Thu, 14 Oct 2004 23:26:05 +1000, Andrew Poulos wrote:
    >>>
    >>>
    >>>> 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).
    >>>
    >>>
    >>>
    >>>
    >>> ..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

    >
    >
    > 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
    Andrew Poulos, Oct 15, 2004
    #5
  6. Andrew Poulos

    Robert Guest

    Andrew Poulos <> wrote in message news:<416e7ee1$0$14524$>...
    > 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
    Robert, Oct 15, 2004
    #6
  7. Andrew Poulos

    Randy Webb Guest

    Robert wrote:

    > Andrew Poulos <> wrote in message news:<416e7ee1$0$14524$>...
    >
    >>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


    The problem with xbm images is its lack of support in non-IE browsers.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 15, 2004
    #7
  8. Andrew Poulos wrote:
    > 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.
    Richard Cornford, Oct 15, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. yer darn tootin
    Replies:
    3
    Views:
    2,696
    yer darn tootin
    Mar 6, 2005
  2. =?Utf-8?B?SklNLkgu?=

    Q: drawing a line

    =?Utf-8?B?SklNLkgu?=, Apr 8, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    418
    Scott Allen
    Apr 9, 2005
  3. Replies:
    1
    Views:
    623
    Kevin Spencer
    Jan 9, 2006
  4. Spartanicus

    2 colour line drawing image format

    Spartanicus, Jan 19, 2004, in forum: HTML
    Replies:
    3
    Views:
    488
    Paul Furman
    Jan 19, 2004
  5. defn noob
    Replies:
    1
    Views:
    373
    Mark Space
    Jun 28, 2008
Loading...

Share This Page