473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

line drawing library

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
Jul 23 '05 #1
8 3797
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.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #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
Jul 23 '05 #3
On Fri, 15 Oct 2004 08:23:57 +1000, Andrew Poulos
<ap*****@hotmail.com> 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.
Jul 23 '05 #4
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
Jul 23 '05 #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/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
Jul 23 '05 #6
Andrew Poulos <ap*****@hotmail.com> wrote in message news:<41***********************@per-qv1-newsreader-01.iinet.net.au>...
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
Jul 23 '05 #7
Robert wrote:
Andrew Poulos <ap*****@hotmail.com> wrote in message news:<41***********************@per-qv1-newsreader-01.iinet.net.au>...
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
Jul 23 '05 #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.
Jul 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: C. Alexander | last post by:
I'm making a 'whiteboard' application. I'm trying to have 2+ connected users able to draw at the same time. However, if User1 draws a line, when User2 is drawing, on User1 screen, it will draw...
0
by: Tomi Holger Engdahl | last post by:
I am looking for a solution to add on-line drawing tool to a phpBB discussion board. The idea would be that the users can draw their own simple drawings with the tool and attach them easily as...
9
by: Steve Long | last post by:
Hello, (total GDI newbie) I'm having trouble drawing just a simple line to display in a picturebox. I just want a straight, dotdash line. I have two methods, one works and one doesn't (it cause...
5
by: Zach | last post by:
Hi, I am completely new to VC#.NET graphics code and would like some help to stop me wasting my time up blind alleys. I am looking for a line charting code example. Nothing posh or airy...
7
by: news | last post by:
This may be a stupid question, but if I don't ask I'll never know ;) Ok, here it goes.... I am writing an application that renders an image in one picturebox and a graph in another. The image...
3
by: Gary O | last post by:
I would like to compile a class I have built to a library. I use the following command line: vbc /reference:Microsoft.VisualBasic.dll /t:library...
1
by: Carl Gilbert | last post by:
Hi I am looking to draw a dotted line between two controls at design time and render this at run time in a similar fashion. The most basic application of this would be a panel with two buttons...
2
by: Martijn Mulder | last post by:
I want to know if the mouse is over (hitting) a line. Therefore I created a Region object that holds the line and use the IsVisible() method to test if the mouse hits the line. It doesn't work! In...
13
by: Martijn Mulder | last post by:
I try to define a line with the length of 1 unit (1 pixel) that is, in fact, just a point on the screen. But when I draw it with a wide pen with the appropriate StartCap and EndCap (Round), it will...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.