drawing in javascript

D

David Landy

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.

david
 
T

Toby A Inkster

David said:
how can i create an inline color image in javascript?

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.
 
D

David Landy

Many thanks Toby.

Sadly IE is my main target audience ;-)

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

David.
 

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,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top