2016-05-17 48 views
0

我用Imagick來幾張圖片合併成一個,這裏是代碼:Imagick組合圖像

foreach($this->images as $image) { 
    $stack->addImage($image['imagick']); 
} 

$montage = $stack->montageImage(new ImagickDraw(), $placing, $this->resultWidth."x".$this->resultHeight, 0, 0); 
$montage->writeImage($result); 

我得到這個http://prntscr.com/b54uwe

我試圖連接2個圖像1和2,還需要我幫助,如何將圖像與它們之間的空白相結合?

回答

0

如何將圖像與它們之間的空白區域相結合?

thumbnail_geometry應該包含寬度/高度和偏移量(例如WxH+L+T)。

爲了消除空白,第三個參數是......

$stack->montageImage(new ImagickDraw(), 
        $placing, 
        $this->resultWidth.'x'.$this->resultHeight.'+0+0', 
        0, 
        0);