title: PHP Fatal error: Uncaught exception 'ImagickDrawException' with message 'Unable to set fill pattern URL'
body: <p>I'm using Imagick to create image but it has an error:
  PHP Fatal error:  Uncaught exception 'ImagickDrawException' with message 'Unable to set fill pattern URL'</p>
  
  <p><strong>This is my code:</strong></p>
  
  <p>$im = new Imagick();</p>
  
  <p>$im->newPseudoImage(50, 50, "gradient:red-black");</p>
  
  <p>$im->setImageFormat("png");</p>
  
  <p>$draw = new ImagickDraw();</p>
  
  <p>$draw->pushPattern('gradient', 0, 0, 50, 50);</p>
  
  <p>$draw->composite(Imagick::COMPOSITE_OVER, 0, 0, 50, 50, $im);</p>
  
  <p>$draw->popPattern();</p>
  
  <p>$draw->setFillPatternURL('#gradient');</p>
  
  <p>$draw->setFontSize(52);</p>
  
  <p>$draw->annotation(20, 50, "Hello World!");</p>
  
  <p>$canvas = new Imagick();</p>
  
  <p>$canvas->newImage(350, 70, "white");</p>
  
  <p>$canvas->drawImage($draw);</p>
  
  <p>$canvas->borderImage('black', 1, 1);</p>
  
  <p>$canvas->setImageFormat('png');</p>
  
  <p>header("Content-Type: image/png");</p>
  
  <p>echo $canvas;</p>