note 107709 modified in imagick.setbackgroundcolor by danbrown

From: Date: Thu, 10 May 2012 20:16:11 +0000
Subject: note 107709 modified in imagick.setbackgroundcolor by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-187781@lists.php.net to get a copy of this message
Be cautious and set bgcolor BEFORE importing a SVG with transparency! :-/&#13;&#10;&#13;&#10;&#60;?php&#13;&#10;&#13;&#10;$im = new Imagick();&#13;&#10;$im-&#62;setBackgroundColor(new ImagickPixel(&#39;transparent&#39;));&#13;&#10;&#13;&#10;$im-&#62;readImage(&#39;carte_Alain2.svg&#39;);&#13;&#10;&#13;&#10;$im-&#62;setImageFormat(&#34;png32&#34;);&#13;&#10;&#13;&#10;header(&#39;Content-type: image/png&#39;);&#13;&#10;echo $im;&#13;&#10;?&#62; --was-- Be cautious and set bgcolor BEFORE importing a SVG with transparency! :-/ <? $im = new Imagick(); $im->setBackgroundColor(new ImagickPixel('transparent')); $im->readImage('carte_Alain2.svg'); $im->setImageFormat("png32"); header('Content-type: image/png'); echo $im; http://php.net/manual/en/imagick.setbackgroundcolor.php

« previous php.notes (#187781) next »