首页
开发手册
应用中心
工具
用户中心
FoundPHP Photos: Zoom
English
中文简体
English
上一篇
下一篇
#FoundPHP Photos: Zoom `The default integrated FoundPHP_image support format under the framework:jpg、jpeg、png、gif` `application library address:class/image/resize.php` `The default memory_limit of GD library php is 128M, if you need to process large-size photos, modify it above 512M.` **When using zoom zoom, you can use xy positioning, the default middle positioning** | Left side| Central | Right | | ------------ | ------------ | ------------ | | |
top(top)
| | | left(left) |
center(centered)
| right(right) | | |
bottom(bottom)
| |
**Legend:** ![](data/files/edit/20/05/03/200503_00152031.jpg) ###Zoom the Photo to Center and Fill the Background Color ```php $FoundPHP_image->image('foundphp.jpg'); //standard zoom $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'zoom' =>1, //Scaling )); $FoundPHP_image->save('foundphp_new'); ``` achieve effect: ![](data/files/edit/20/05/03/200503_00226073.jpg)
###Zoom to the left to fill the red background of the photo ------------ We try to position the left side, in order to be more obvious we set the background color #800000 red ```php $FoundPHP_image->image('foundphp.jpg'); //Standard zoom $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'zoom' =>1, //Scaling 'xy' =>'left' //On the left 'bgcolor' =>'#800000', )); $FoundPHP_image->save('foundphp_new'); ``` achieve effect: ![](data/files/edit/20/05/03/200503_00299146.jpg)
###Scale according to the original ratio, set the maximum side length without background filling ------------ ```php $FoundPHP_image->image('foundphp.jpg'); //Standard zoom $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'cut' =>1, 'lock' =>1, //0 width, width and height are not enough to fill the color, 1 zoom the maximum width of the photo )); $FoundPHP_image->save('foundphp_new'); ``` achieve effect: The height is 400 and the width is scaled to 300 ![](data/files/edit/20/05/05/200505_15541581.jpg)