2013-07-09 66 views
0

我想SVG轉換爲使用imagick png圖片,但它顯示空白png格式轉換, 我的imagick代碼SVG使用imagick

<?php 
$im = new Imagick(); 
$im->setBackgroundColor(new ImagickPixel('transparent')); 
$svg = file_get_contents("new_old.svg"); 
$im->readImageBlob($svg); 

$im->setImageFormat("png32"); 

header('Content-type: image/png'); 

echo $im; 
?> 

和代碼爲我的SVG圖像是

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="282" height="504" xmlns:xlink="http://www.w3.org/1999/xlink"> 
<image id="4" preserveAspectRatio="none" x="27" y="132" width="238" height="453" xlink:href="http://asia.olympus-imaging.com/products/dslr/e520/sample/images/thumb_01.jpg"/> 
</svg> 

任何人都可以爲這些問題提供解決方案。

+0

請https://stackoverflow.com/questions/31262447/svg-to-png-with-多圖像層-使用的PHP –

回答