drawing in javascript

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
how can i create an inline color image in javascript? the code snippet
below (which was posted on this group in 2000) shows how to do a
single-bit image -- how can this be extended to eg 8-bit color depth?

thanks for any help you can give.


Quoted text here. Click to load it

Re: drawing in javascript

David Landy wrote:

Quoted text here. Click to load it

What browsers is it important for this to work in? If IE isn't important,
perhaps the "data:" URL scheme might be your friend. For example:

<a href="data:text/plain,Hello%20World">greeting</a>

See http://www.ietf.org/rfc/rfc2397.txt for more details.

If this on its own isn't an option (for example, IE support is required),
it is probably possible to use the above scheme and then use some
JavaScript to decode the "data:" URL and display it in Internet Explorer.

Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

Re: drawing in javascript

Many thanks Toby.

Sadly IE is my main target audience ;-)

Any idea how to decode the data: and turn it into an image source?


Quoted text here. Click to load it

Site Timeline