473,909 Members | 5,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2316
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.javas cript:
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/c446f7216156869 8>

<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.de mon.co.uk>, dated Tue, 21
Dec 2004 23:26:03, seen in news:comp.lang. javascript, Richard Cornford
<Ri*****@litote s.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.demo n.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.idiotsdelig ht.net/minitrue/> Update hope?
Jul 23 '05 #4
On Tue, 21 Dec 2004 23:26:03 -0000, "Richard Cornford"
<Ri*****@litote s.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
22467
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 simplicity sake, I would be prepared to draw using characters such as _ or * if proper line drawing is really complicated. Thanks in advance. Walt
0
2842
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.
20
2417
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 used the autoshapes to create this diagram). I was wondering what the best way to incorporate this into the DB. I have read about how saving them as pictures in the DB bloats the size, which is unacceptable, but it needs to be easy to do (not...
9
2419
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() {
0
1276
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 drawing-area need to have a bitmap as a background and on that bitmap, the user should be able to put/create approx. 10 different custom-made objects. Objects should not be resized. Some should be possible to rotate and some not. Custom lines with arrows on...
10
3456
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 with dashed or colored lines and filled or transparent surfaces (or maybe semitransparent). I would then like to set the camera and have the scene depicted as a line drawing (not ray-traced solid body, etc).
0
4272
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 QFrame. It works, but i would like to make my objects (cubic...) movable, so i want to redefines dragEnterEvent dropEvent and mousePressEven into each of objects wich are QLabel, and it doesn't work. I thought i could write the dragEnterEvent...
3
1832
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 some databases)? The resulting application can be either embedded on the web page or runnable directly from the web page - if it is possible with minimal depending installations on client computer. I know about Flash, Director or Java3D...
0
1501
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 main panel picture as a background to it so after i can add other pictures on this main panel or other ways ?. Anything you suggest would be great help. Thanks in advance.
0
10037
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10540
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
9727
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...
1
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7249
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
5938
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...
1
4776
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
2
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3359
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.