在svg图片标记

时间:2017-06-08 13:42:38

标签: javascript angularjs svg

我以这种方式创建一个临时文件$scope.imgData = URL.createObjectURL(curFile);

在我的html文件中,我试图在svg中显示它,但没有显示任何内容。这是我的HTML:

<svg width="780" ng-attr-height="625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink"  style="cursor:crosshair; padding-top: 16px;" ng-mousemove="updateCoords($event)" >
    <image id="MyImg" xlink:href="" ng-href="{{ imgData }}" x="0" y="0" height="625px" width="780px"/>
</svg>

如果我下载imgData内的链接(类似blob:http://localhost/397f996a-d456-4f25-b9ed-f210d2c38a57),并以jpg打开,我就可以看到该图片。

有什么问题?

0 个答案:

没有答案