JavaScript / For painting or drawing - anything out there like this?

J

julierbriggs

hi, is there a pure javascript code (no Java applets), for painting or
drawing using a e-pencil or something, in a defined space on the
screen? best regards-:)JB:)
 
C

cwdjrxyz

hi, is there a pure javascript code (no Java applets), for painting or
drawing using a e-pencil or something, in a defined space on the
screen? best regards-:)JB:)

I do not know exactly what you want to draw or paint, but script seems
to be a difficult method to do this if you want to do anything very
complicated. A good graphics program such as PaintShop is likely to be
far easier to use for this sort of thing. You can generate simple
images such as some geometric figures using the math functions of
javascript, but this requires that you know a little analytical
geometry as well as how to use the script math functions to do this.
Using script to move images around that you already have (dhtml) is
often not too difficult if you can write your own script. There also
are some programs that will allow you to draw things using the cursor
and screen. My Windows XP includes a little Microsoft program to do
that.
 
L

Laurent Bugnion

Hi,

hi, is there a pure javascript code (no Java applets), for painting or
drawing using a e-pencil or something, in a defined space on the
screen? best regards-:)JB:)

JavaScript is not good at graphics. On the Web, a possible alternative
is SVG which can be scripted, thus allowing including new graphical
elements. However, SVG is likely to disappear soon (oh the controversy
,-) because of its very poor support by Adobe, and by the coming-soon of
WPF/E (CTP this July, release this winter) by Microsoft.

WPF/E is a very powerful graphics engine which will run in IE6, IE7,
Firefox, Opera on Windows, Safari on Macintosh, and later on Linux OSs.
WPF/E will support C# business logic and will also be scriptable. Very
exciting stuff really.

See Mike Harsh's blog for details.
http://blogs.msdn.com/mharsh

HTH,
Laurent
 
C

cwdjrxyz

cwdjrxyz wrote:
There also
are some programs that will allow you to draw things using the cursor
and screen. My Windows XP includes a little Microsoft program to do
that.

If you have or can use a computer with the Microsoft XP operating
system, go to Start, select Accessories, and then select Paint. This is
the program I had in mind, and it came installed on my computer. I have
not used it, because PaintShop that I have handles image work that I
need much better for me. I do not know the details of how this program
is written, but it most likely uses some higher level computer
languages such as C++, Java, etc as javascript often is too limited for
elaborate programs designed to be run on a PC.
 
L

Laurent Bugnion

Hi,

cwdjrxyz wrote:
If you have or can use a computer with the Microsoft XP operating
system, go to Start, select Accessories, and then select Paint.

I got to say, I fail to see how that will help the OP... Paint can
obviously not be embedded in a web page (don't start talking about
ActiveX please ;-) and is probably not what the OP had in mind.

This is
the program I had in mind, and it came installed on my computer. I have
not used it, because PaintShop that I have handles image work that I
need much better for me. I do not know the details of how this program
is written, but it most likely uses some higher level computer
languages such as C++, Java, etc as javascript often is too limited for
elaborate programs designed to be run on a PC.

A programming language is only as limited as the programer's knowledge
;-) or as the framework it runs on. Using JScript.NET, for example, you
can do exactly the same as you would in C#, because the .NET framework
exposes all the objects to JScript.NET. In the case of the web browser,
the JavaScript framework doesn't allow painting on the screen, which is
why it would be awkward to use JavaScript as a graphical framework in
the web browser.

HTH,
Laurent
 
C

cwdjrxyz

Laurent said:
Hi,

cwdjrxyz wrote:
If you have or can use a computer with the Microsoft XP operating

I got to say, I fail to see how that will help the OP... Paint can
obviously not be embedded in a web page (don't start talking about
ActiveX please ;-) and is probably not what the OP had in mind.

The OP did not specify if he or she wanted something that would work
online for someone viewing a web page or if something was wanted that
will allow drawing and painting while on the computer and offline. Just
because one has a PC does not imply that it is used mainly on the web,
or at all. Many PCs are never connected to the web. So unless one of us
knows the OP, or has received an email, we can only guess what is
wanted. We both have mentioned a few things that might work off and/or
on the web. If the OP finds any of these leads interesting, a more
detailed post might allow a more focused response. From the tone of the
OP post and their profile, I am guessing that something rather simple
and readymade is desired, but I am only guessing and could be very
wrong.
 
C

cwdjrxyz

cwdjrxyz said:
cwdjrxyz wrote:
There also

If you have or can use a computer with the Microsoft XP operating
system, go to Start, select Accessories, and then select Paint. This is
the program I had in mind, and it came installed on my computer. I have
not used it, because PaintShop that I have handles image work that I
need much better for me. I do not know the details of how this program
is written, but it most likely uses some higher level computer
languages such as C++, Java, etc as javascript often is too limited for
elaborate programs designed to be run on a PC.

There is a free image program at
http://www.imagemagick.org/script/index.php that you can download that
allows you to process images in many ways as well as paint and draw on
your computer. In addition, there have been online versions of this
program that you can use without downloading the program. These often
were used by WebTV users who cannot download anything. You can find and
introduction and link to an online version at
http://members.tripod.com/~ImageMagick/ . If you have the right host
you could even put ImageMagick, or portions thereof, up on the server
to allow users of you pages to use it or portions thereof. Some hosts
that cater to WebTV users, such as wtv-zone, have portions of
ImageMagick on their file manager pages. However I hear that the full
program requires huge server resources and it could slow a server down
greatly if a few people use it at one time. Many web host would not
allow you to install and keep the full version as it could slow down
the server too much.
 
J

julierbriggs

I don't know about WPF/E, but you are so definately right about Adobe.
I'll avoid SVG and look at new technologies. Thank you so much!
--Julie
 
E

Evertjan.

wrote on 12 jun 2006 in comp.lang.javascript:
[please do not toppost on usenet]
I don't know about WPF/E, but you are so definately right about Adobe.
I'll avoid SVG and look at new technologies. Thank you so much!


Simple "graph" graphics can very well be done by clientside javascript:

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

as I showed oct 2004 here:
<http://groups.google.com/group/microsoft.public.scripting.jscript/msg/2eb2
9ecafa6105bf?hl=nl&>

This is usefull for dynamic graphs, as static ones can better be shown as
an image.
 
C

cwdjrxyz

You can generate simple
images such as some geometric figures using the math functions of
javascript, but this requires that you know a little analytical
geometry as well as how to use the script math functions to do this.

I looked at a few of my old backups and pulled out a few examples of
using javascript to draw and paint geometric images. For a limited
time, these examples will be posted at my site at
http://www.cwdjr.net/geometricDraw/ . I am afraid these do not use an
e-pencil, and your "something" option is javascript math functions :)
.. Some of the code is old and likely could be improved, but I do not
have the time or interest to go over all of this again. At least the
code validates as CSS and as html 4.01 strict at the W3C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top