我需要創建一個具有一定大小(45釐米寬x 32釐米高)的白色背景Imagick PHP的圖像,並複製他在一個圖像,我有一個文件夾中的某個固定位置。插入圖像到另一個圖像Imagick
我可以幫忙嗎?
問候,並非常感謝你
我需要創建一個具有一定大小(45釐米寬x 32釐米高)的白色背景Imagick PHP的圖像,並複製他在一個圖像,我有一個文件夾中的某個固定位置。插入圖像到另一個圖像Imagick
我可以幫忙嗎?
問候,並非常感謝你
imagecopy是你需要的功能
作物形象的例子:
<?php
// Create image instances
$src = imagecreatefromgif('php.gif');
$dest = imagecreatetruecolor(80, 40);
// Copy
imagecopy($dest, $src, 0, 0, 20, 13, 80, 40);
// Output and free from memory
header('Content-Type: image/gif');
imagegif($dest);
imagedestroy($dest);
imagedestroy($src);
?>
,如果你只需要添加一個白色背景imagefill是你的函數:
$image = imagecreatetruecolor(100, 100);
// set background to white
$white = imagecolorallocate($im, 255, 255, 255);
imagefill($image, 0, 0, $white);
查看本項[如何合併3 i mages成1圖像通過PHP?](http://stackoverflow.com/questions/4419383/how-can-i-merge-3-images-into-1-image-via-php) –
看到http:// stackoverflow .com/questions/3876299/merge-two-images-with-php –