Results 1 to 2 of 2

Thread: HTML5 Canvas Containing SVG Image

  1. #1
    Join Date
    Apr 2004

    HTML5 Canvas Containing SVG Image


    I have a canvas on which is some text and an SVG image. I am now trying to use getImageData to copy the contents to another canvas. However, I am getting a DOM Security Exception 18 error when calling the getImageData command. I know that this error is normally thrown when the image does not reside on the same domain as the HTML, but both of them DO reside on the same domain. In fact, if I change the SVG image to a gif or png, they both work without issue.

    So, why won't the SVG image work and how can I get around this?


  2. #2
    Join Date
    Apr 2004
    Could the reason be that SVG images have external links in their XML?

    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
    x="0px" y="0px" width="100%" height="100%" viewBox="0 0 250 250" enable-background="new 0 0 250 250" 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center