473,796 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3835
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*****@hotmai l.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.javas cript 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*****@hotmai l.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*****@hotmai l.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.javas cript 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.j s - 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
2729
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 another line, connecting User1's, and User2's current X,Y position. Same thing happens with User2. But User3, and User4 is not drawing, and see the lines drawn individually.
0
2780
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 images in the discussion. The idea is to easily add small drawings to the postings. The drawign tool should be easy to use and learn. It should be easily integrate to the phpBB system.
9
2412
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 an exception to be thrown): This one works but it's not the results I want. private void CreateImage1() {
5
8654
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 fairy, just a simple area with annotated axis and a graph. I am not looking for code to create a multi applicable graphic contol and I don't want to buy a library. I have been around the Code Project and I
7
3224
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 is drawn by loading a jpg into a bitmap and then setting picturebox.image = mybitmap. Ive created my own class, inheriting from the picturebox and overriding the OnPaint event so I can do e.Graphics.DrawImage (this.image....). This renders...
3
1807
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 /sdkpath:c:\windows\microsoft.net\framework\v1.1.4322 ClockControl.vb But I get the following errors (not all are listed): vbc /reference:Microsoft.VisualBasic.dll /t:library /sdkpath:c:\windows\microsof t.net\framework\v1.1.4322 /imports:System,System.Drawing ClockControl.vb Microsoft (R)...
1
3373
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 on it. I would then draw a dotted line between the two. This line would then have to move when either of the two buttons move to update the connection between the two.
2
10410
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 the little program below I create two Regions: one is square, the other is a line. Hit testing works on the square-Region, not on the line-Region. How can I do a hit-test over a line? //namespace HitTest namespace HitTest
13
2394
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 appear as a dot. I can think of a way to define a 1-pixel long line but it is ugly and clumsy. I subtract .5 from the given pixel's X and Y coordinate for the first System.Drawing.PointF structure, and add .5 to the other PointF stucture. It...
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.