Using one platform to build another [HTML 5’s canvas tag implemented using Silverlight!]

This blog has moved to a new location and comments have been disabled.

All old posts, new posts, and comments can be found on The blog of

See you there!

Comments (15)
  1. rbirkby says:

    I don’t see a license to this code. Is it unlicensed? It would be nice to Ms-PL it.

  2. David Anson says:


    This code is already licensed under Ms-PL. 🙂

    (The "News" section in the column on the right side of my blog is where I call this out.)


  3. chadbr says:

    You are an animal. Impressive work.

  4. David Anson says:

    LOL, thanks chadbr! 🙂

  5. zachleat says:

    Are there any statistics on Silverlight adoption percentages for Internet Explorer users?

  6. benjoffe says:

    For testing purposes my current PC is using IE7 (with silverlight) but your sample demo is not working with it. Have you tested this with IE 6 and 7?

  7. David Anson says:


    I’ve seen various companies report adoption percentages and I honestly don’t know which ones are most accurate. I think I remember hearing that something like 1/3 machines had Silverlight installed a few months ago, so it’s probably at least that by now.


    I’ve tested with Win7/IE8, W2K8/IE8, and Win7/Firefox 3.5. However, I’d be pretty surprised if things didn’t "just work" on IE7. Yours is the first report of this I’ve had – could you maybe follow up with me directly (use the "Email" link at the top right and I’ll reply to you) and we can try to sort out what’s causing you trouble.


  8. fabien.menager says:

    @benjoffe Did you run the sample demo from Visual Web Developer ? First time I tried the sample demo I just ran it on the browser, without running it from VWD and it didn’t work (of course, the Silverlight file must be compiled).

    @Delay Nice work, but the first Silverlight canvas with the colored squares doesn’t seem to work here (and it throws an unhandled exception).

    Could you add the sample demos you are showing us on this page to the zip?

    Wouldn’t you be interested in working with the ExCanvas team to make a very good <canvas> implementation for IE (which would work with or without SL)?

    Finally, I’d really like <canvas> to be implemented in IE, without the need for a plugin, that only 1/3 of the browsers have.

  9. David Anson says:


    I’ve just re-verified the ZIP download on my machine and uploaded the resulting files so that everyone can run them without having to compile first. So I don’t think it’s the ZIP that’s causing problems. Could you please try the following link which should load fine for you in IE or Firefox if you’ve got Silverlight 3 installed:

    If you have a problem running the samples from that link, could you please contact me via the "Email" link and let me know what the specifics of the error are? Thanks.

    Regarding sharing the source of the applications I showed, I’m not doing that because I don’t want to be in the place of redistributing someone else’s stuff. The changes I made to get those samples running were really trivial find/replace-style stuff in the HTML files, so it should be fairly straightforward if that’s what you’re trying to do. Sorry for the inconvenience!

    Regarding working on ExCanvas, my day job and blogging already consume pretty much all the free time I have. 🙂

    Regarding native <canvas> support in IE, I agree that would be nice!. If this post helps that process along at all, I’ll be pretty happy. 🙂

  10. David Anson says:


    Is it possible that you ran into the same culture bug that Fabien reported above and which I’ve just fixed here:

    If so, that would nicely wrap up both customer issues I’ve seen so far and I’d be a happy camper! 🙂

  11. Blog HTML says:

    A very much professional platform.

  12. Brad says:

    Hi David,

    Very good article.

    I have a question:

    I have a video tag and the source of the video being in the same folder as the page that displays it. I also have a canvas on that page and by clicking a button I draw the video's image at a specific frame onto the canvas. When I try and execute the canvas's method toDataURL() after I have drawn the image from the video to the canvas (ctxDraw.drawImage(video, 0, 0, w, h);) I get the following: dom exception: Security_ERR(18). I would have thought that because the video is local that it should allow me to gather the pixel data and should keep the canvas's origin-clean flag clean?

    Your help and advise on this matter will be greatly appreciated as I have been struggling with it for a while.

  13. David Anson says:


    Thanks! 🙂 I'm afraid I don't have experience with this kind of scenario, so I doubt I can help. However, the following link seems to suggest that your theory is on the right track and that you may be able to get things working with a bit of tinkering:…/2705057

    Hope this helps!

Comments are closed.

Skip to main content