首页
开发手册
应用中心
工具
用户中心
FoundPHP 照片:裁切
中文简体
中文简体
English
上一篇
下一篇
#FoundPHP 照片:裁切 `框架下默认集成 FoundPHP_image 支持格式:jpg、jpeg、png、gif` `应用库地址:class/image/resize.php` `采用GD库php默认memory_limit是128M,如果需要处理大尺寸照片修改512M以上。` **采用缩放zoom的时候可以用xy定位,默认中间定位** | 左侧 | 中部 | 右侧 | | ------------ | ------------ | ------------ | | |
top(顶部)
| | | left(左边) |
center(居中)
| right(右边) | | |
bottom(底部)
| |
**图例:** ![](data/files/edit/20/05/03/200503_00152031.jpg) ###裁切居中照片 ```php $FoundPHP_image->image('foundphp.jpg'); //标准缩放 $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'cut' =>1, //1切图,0不切图 'zoom' =>1, //按比例缩放 )); $FoundPHP_image->save('foundphp_new'); ``` 实现效果: ![](data/files/edit/20/05/05/200505_15466562.jpg) ###裁切居底照片 ```php $FoundPHP_image->image('foundphp.jpg'); //标准缩放 $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'cut' =>1, //1切图,0不切图 'zoom' =>1, //按比例缩放 'xy' =>'bottom' //底部 )); $FoundPHP_image->save('foundphp_new'); ``` 实现效果: ![](data/files/edit/20/05/05/200505_15488831.jpg)