I examined http://www.imagemagick.org/Usage/draw/ as well as several other pages but was unable to find any reference to drawing a shape and to have it filled with a gradient.
I am writing a php script to generate an image based on user input. This is what I wrote so far:
Code: Select all
<?
foreach(${"_" . $_SERVER["REQUEST_METHOD"]} as $k=>$v) $$k=$v;
// Create image
$w = 240; $h = 240;
$im = new Imagick();
$im->newPseudoImage($w, $h, "gradient:$bgFrom-$bgTo");
$im->setImageFormat("png");
// Draw coin border
$draw = new ImagickDraw();
$draw->setStrokeColor( new ImagickPixel("blue"));
$draw->setStrokeWidth(4);
$draw->setFillColor( new ImagickPixel( "green" ) );
$draw->circle(120, 120, 38, 38);
$im->drawImage( $draw );
// Output image
header("Content-type: image/png"); echo $im; $im->clear(); $im->destroy();
?>
Currently the background is created with a gradient. The circle, however, is solid green with blue border. How can I produce a circle filled with a gradient?
I stumbled upon viewtopic.php?t=8149 and it seems related, but it also from a few years ago and doesn't offer a solution.