/** ????* 按坐标裁图 ????* 参数:起始坐标,裁剪长宽,图片 ????* 坐标($h,$w) ????* 长宽($height,$weight) ????*/ ???public function actionCutByPoint() ???{ ???????// $data = $_POST; ???????$data = $_GET; ???????$filename = dirname(dirname(dirname(dirname(__FILE__)))).‘\web\upload_pic\test114.png‘; ???????$source = imagecreatefrompng($filename); ???????list($PNGWidth, $PNGHeight) = getimagesize($filename); ???????$thumb = ImageCreateTrueColor( $data[‘weight‘],$data[‘height‘]); ???????imagecopyresized( $thumb, $source, 0, 0, $data[‘w‘], $data[‘h‘], $data[‘weight‘], $data[‘height‘], ?$data[‘weight‘], $data[‘height‘]); ???????imagejpeg( $thumb , "./upload_pic/Cut/{$data[‘w‘]}-{$data[‘h‘]}.jpg" ,100); ???}
PHP按坐标裁图
原文地址:https://www.cnblogs.com/liuliwei/p/9319066.html