473,371 Members | 1,492 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,371 software developers and data experts.

drawing pictures

Hi Folks

Is it possible to draw pictures with Javascript? I would like to draw a
poly something (i.e. a shape with coordinates). It is for a mouse-over
effect to highlight certain areas on a map.

TIA

- Nicolaas
Jul 23 '05 #1
4 2292
WindAndWaves wrote:
Hi Folks
Does that mean that it has finally occurred to you that Indian mystics
are maybe not the best people to be addressing javascript questions to?
Is it possible to draw pictures with Javascript?
Yes (in the sense that various host provide scriptable facilities that
will allow the drawing of pictures. For example, PhotoShop (from version
7) can be scripted with ECMAScript, but SVG UAs and plugins are also
often scriptable).
I would like to draw a poly something (i.e. a shape with
coordinates). It is for a mouse-over effect to highlight
certain areas on a map.


So you are probably talking about an HTML UA context, where drawing
polly shapes may be a matter of creating and positioning hundreds
(potentially thousands) of CSS positioned DIV elements. That can be done
but don't expect the results to be quick (or the required code to be
small and simple).

You might like to take a look at the JS vector graphics library at:-

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

Richard.
Jul 23 '05 #2
WindAndWaves wrote on 21 dec 2004 in comp.lang.javascript:
Is it possible to draw pictures with Javascript? I would like to draw a
poly something (i.e. a shape with coordinates). It is for a mouse-over
effect to highlight certain areas on a map.


<http://groups-
beta.google.com/group/comp.lang.java.javascript/msg/c446f72161568698>

<http://devrijehuisarts.org/test/jsgraph.asp>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #3
JRS: In article <cq*******************@news.demon.co.uk>, dated Tue, 21
Dec 2004 23:26:03, seen in news:comp.lang.javascript, Richard Cornford
<Ri*****@litotes.demon.co.uk> posted :

So you are probably talking about an HTML UA context, where drawing
polly shapes may be a matter of creating and positioning hundreds
(potentially thousands) of CSS positioned DIV elements. That can be done
but don't expect the results to be quick (or the required code to be
small and simple).

Let there be created, preferably in the public domain, images of
squares. Let there be sets of squares, of side 16 32 64 128 256 pixels.
Let each set consist of the 256 squares with all combinations of "radii"
on and off. Let a radius be a 1px-wide black line from the centre to a
corner or side mid-point of a white square.

Name them with computable names including the size and a binary encoding
of the radii used.

ISTM that quite a lot of diagramming could be done by filling a
borderless, etc., Table with such images. A preliminary test indicates
so, except that it might be better to use sides of 2^n+1 or 2^n-1, to
help diagonals. have the same visual weight as other lines.

Those figures would tend to get cached. Special figures could be used
for particular parts of diagrams. When the diagram was hand-coded,
colspan rowspan and image height/width control might help.

It would not be the equivalent of proper graphics, but it should compete
with ASCII art for line diagrams. It could be output by program from a
diagram in some other form.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
I find MiniTrue useful for viewing/searching/altering files, at a DOS prompt;
free, DOS/Win/UNIX, <URL:http://www.idiotsdelight.net/minitrue/> Update hope?
Jul 23 '05 #4
On Tue, 21 Dec 2004 23:26:03 -0000, "Richard Cornford"
<Ri*****@litotes.demon.co.uk> wrote:
Yes (in the sense that various host provide scriptable facilities that
will allow the drawing of pictures. For example, PhotoShop (from version
7) can be scripted with ECMAScript, but SVG UAs and plugins are also
often scriptable).


SVG is probably a good choice for the OP. There's already plenty of
examples that do it. off the top of my head www.onemag.org does it,
but so do lots of others.

Jim.
Jul 23 '05 #5

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

Similar topics

8
by: john | last post by:
Hi I am a C++ newbie, I am looking to draw single lines and simple boxes in a C++ console window. Is there a draw command with x and y coordinates that can be used with my Dev C++ compiler. For...
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...
20
by: Greg | last post by:
I'm fairly new to access (using 2002) and am setting up a DB for work. along with each record the user also needs to make a flow diagram (previously, these reports were composed in word and they...
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...
0
by: Hakan Andersson | last post by:
Hi! I'm a system designer/programmer starting up a new project where we want to be able to let the end user create graphic pictures. The application will be web-based using C#. The...
10
by: James Stroud | last post by:
Hello All, I'm looking for a program to do line-drawings in 3d, with output to postscript or svg or pdf, etc. I would like to describe a scene with certain 1-3d elements oriented in 3d space...
0
by: jijiz | last post by:
Hi everyone, My english is quite poor... I prefer inform you about it... So i would like to draw some pictures (cubic, square, lines) into objects (QLabel), and instanciate those objects into a...
3
by: =?Utf-8?B?ZGV2ZWxvcHNj?= | last post by:
Hi, can you guide me, which MS technologies are suitable to create drawing application (simple CAD application) on the web - to allow 2D/3D drawing on some canvas and use data stored on server (in...
0
by: desturrr | last post by:
I am using netbeans ide gui designer , i have placed a panel which has a picture in it , and i want to place another tiny pictures on this main picture, What can i do to manage this , Can i make the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.