没具体做过试试用imagecreate()创建空白图像,用imagecopy()把3个图片依次拷过去?

解决方案 »

  1.   

    这是分隔图片的代码
    imagecreatefromjpeg 用来获取图片的标志符
    imagecreatetruecolor用来生成新的图布标志符imagecopyresampled用来从图片拷到新的画布里,这是关键的地方.header("Content-type: image/jpeg");
    $imgName = $_GET['image'];
    $startingW = $_GET['startingW'];
    $width = $_GET['width'];
    $startingH = $_GET['startingH'];
    $height = $_GET['height'];
    $im = imagecreatefromjpeg($imgName);
    $im1 = imagecreatetruecolor($width, $height);
    //imagecopy($im1, $im, 0, 0, $startingW, $startingH, $width, $height);
    imagecopyresampled($im1, $im, 0, 0, $startingW, $startingH, $width, $height, $width, $height);imagejpeg($im1);imagedestroy($im);
    imagedestroy($im1);