I can't get it to work it just does nothing. I'm using Image_Canvas PEAR package on shared hosting it works but I can't crop image.
My syntax is:
$Ca开发者_如何学编程nvas->setClipping(array('x0' => 10, 'y0' => 10, 'x1' => 200, 'y1' => 200));
Any ideas?
I am not that familiar with Image_Canvas PEAR package, but I have tried it just now and found that setClipping will work if you add a second call to the same method without any parameters!
$Canvas =& Image_Canvas::factory((isset($_GET['canvas']) ? $_GET['canvas'] : 'png'), array('width' =>500, 'height' => 333, 'filename' => 'yourImage.jpg'));
$Canvas->setClipping(array('x0' => 10, 'y0' => 10, 'x1' => 200, 'y1' => 200));
$Canvas->image(array('x' => 0, 'y' => 0, 'filename' => './yourImage.jpg'));
$Canvas->setClipping();
$Canvas->show();
精彩评论