Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从图像Base64字符串创建SVG,PHP_Php_Svg - Fatal编程技术网

从图像Base64字符串创建SVG,PHP

从图像Base64字符串创建SVG,PHP,php,svg,Php,Svg,我在PHP变量中有Base64中的图像字符串。我需要创建SVG图像,其中包含的图像可以是PNG/GIF/JPG,从该字符串可以得到什么 有什么方法可以做到这一点吗?是的,有一种方法可以做到这一点,我将让您创建用于创建SVG图像的逻辑。但这里有一些有用的链接和一些基本知识: 查看W3HTML SVG参考: 有了这些逻辑,您可以创建自己的SVG图像,您可能希望通过Google进行PHP文件的编写和读取 编辑: 您可以在svg标记中添加图像 <svg width="5cm" height="4c

我在PHP变量中有Base64中的图像字符串。我需要创建SVG图像,其中包含的图像可以是PNG/GIF/JPG,从该字符串可以得到什么


有什么方法可以做到这一点吗?

是的,有一种方法可以做到这一点,我将让您创建用于创建SVG图像的逻辑。但这里有一些有用的链接和一些基本知识:

查看W3HTML SVG参考:

有了这些逻辑,您可以创建自己的SVG图像,您可能希望通过Google进行PHP文件的编写和读取

编辑:

您可以在svg标记中添加图像

<svg width="5cm" height="4cm" version="1.1"
     xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <image xlink:href="https://www.gettyimages.com/gi- 
       resources/images/CreativeLandingPage/HP_Sept_24_2018/CR3_GettyImages- 
      159018836.jpg" x="0" y="0" height="50px" width="50px"/>
</svg>

这只创建了没有图像的SVG,我需要在SVG中获得图像,只有一个圆圈:我想我了解你想要什么,我的编辑是否有助于解决你的问题是的,但我需要图像链接作为字符串-base64你能进一步解释吗?你的图像字符串看起来如何?你能举个例子吗?
<svg width="5cm" height="4cm" version="1.1"
     xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <image xlink:href="https://www.gettyimages.com/gi- 
       resources/images/CreativeLandingPage/HP_Sept_24_2018/CR3_GettyImages- 
      159018836.jpg" x="0" y="0" height="50px" width="50px"/>
</svg>