我会使用Imagick将svg转换为png,但会变成黑色阴影。我该如何删除它。我使用以下代码。
http://imageshack.com/a/img538/9707/Cs5BLb.jpg
<?php
$genislik = $_GET["gs"];
$yukseklik = $_GET["ys"];
$renk = $_GET["a"];
$sekil = $_GET["y"];
$boyut = $_GET["z"];
$stl = $_GET["yb"];
if ($stl=="1") {
$bold = "bold";
} else {
$bold = "normal";
}
$im = new Imagick();
$im-> setResolution ($genislik, $yukseklik);
$im->setBackgroundColor(new ImagickPixel('transparent'));
$svg = '<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1400" height="300">
<text x="0" y="80" style="fill: #'.$renk .'; font-family: monospace; font-size: '.$boyut.'px; font-weight: '.$bold.';">'.$sekil.'</text>
</svg>';
$im->readImageBlob($svg);
$im->trimImage(0);
$im->setImageFormat("png32");
header('Content-type: image/png');
echo $im;
?>
scaleImage()shadow fades当我使用代码时。但决议正在发生损失。
$d = $im->getImageGeometry();
$w = $d['width'];
$h = $d['height'];
$im->scaleImage($w-0.1, $h-0.1);