Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > line drawing library

Reply
Thread Tools

line drawing library

 
 
Andrew Poulos
Guest
Posts: n/a
 
      10-14-2004
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
 
Reply With Quote
 
 
 
 
Andrew Poulos
Guest
Posts: n/a
 
      10-14-2004
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
 
Reply With Quote
 
 
 
 
Jim Ley
Guest
Posts: n/a
 
      10-14-2004
On Fri, 15 Oct 2004 08:23:57 +1000, Andrew Poulos
<(E-Mail Removed)> 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.
 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      10-15-2004
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/hikksnotathom...hit/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
 
Reply With Quote
 
Andrew Poulos
Guest
Posts: n/a
 
      10-15-2004
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/hikksnotathom...hit/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
 
Reply With Quote
 
Robert
Guest
Posts: n/a
 
      10-15-2004
Andrew Poulos <(E-Mail Removed)> wrote in message news:<416e7ee1$0$14524$(E-Mail Removed)>...
> 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
 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      10-15-2004
Robert wrote:

> Andrew Poulos <(E-Mail Removed)> wrote in message news:<416e7ee1$0$14524$(E-Mail Removed)>...
>
>>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
 
Reply With Quote
 
Richard Cornford
Guest
Posts: n/a
 
      10-15-2004
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Guide to the standard library? Library for drawing in GUIs?drawing inbrowsers? defn noob Java 1 06-28-2008 02:50 AM
Maths expression drawing library Ross Clement (Email address invalid - do not use) Java 4 10-02-2006 05:52 AM
[SVG] problem with SVG image drawing with Batik Library Mardagg Java 0 05-12-2006 02:12 PM
funny drawing software:ScreenPen,drawing directly on screen! yyzzbb@sina.com Digital Photography 0 02-04-2006 12:31 AM
System.Drawing For Drawing Text Images jjbutera@hotmail.com ASP .Net 1 01-09-2006 09:55 PM



Advertisments