Patient Guy wrote:
1. The user specifies the plot (x,y) data through an interactive HTML form
interface (its elements).
2. Upon receiving a click event that all data is entered, the script
renders a bitmap which is then formatted to the GIF specification.
3. An OBJECT node (element) is created and its 'type' and 'data'
attributes appropriately set. 'type' is 'image/gif' and 'data' is encoded
binary of the GIF data (encoding likely to be base64).
The problem is step (2). I have not toyed with core Javascript
sufficiently to know if binary data sequences can be manipulated. They
certainly cannot be manipulated using Strings. It is possible that they
can be manipulated as Array objects (with Unicode elements? Number-type
elements?).
Long ago someone (Roger Critchlow) came up with pnglets:
<http://www.elf.org/pnglets/>
Still working in Mozilla, you use a URL with the javascript: pseudo
protocol and a script exression returning a string with the image data.
It is not GIF but PNG. And don't expect that to work with other
browsers. That author made also some other attempts still noted here:
<http://www.elf.org/essay/inline-image.html>
and might have even discussed long ago in comp.lang.javascript why he
choose PNG over GIFs but I don't remember details, search yourself
<http://groups.google.com/groups?as_q=&num=10&scoring=r&hl=en&as_epq=&as_oq=&as_eq=&as_ugroup=comp.lang.javascript&as_usubject=&as_uauthors=Critchlow&lr=&as_drrb=q&as_qdr=&as_mind=1&as_minm=1&as_miny=1981&as_maxd=15&as_maxm=11&as_maxy=2005&safe=off>
You have already been told that IE has VML and drawing APIs, that Opera
8 already supports SVG, that the upcoming Firefox 1.5 has SVG and canvas
support. Much better than attempts to create binary image data with
JavaScript.
--
Martin Honnen
http://JavaScript.FAQTs.com/
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom