首页
开发手册
应用中心
工具
用户中心
FoundPHP Photo:Color Block
English
中文简体
English
上一篇
下一篇
#FoundPHP Photo:Color Block `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.` ###Add Color Blocks at Any Coordinate ------------ The position of the color block is in the lower layer of the text and can be used as the background color of the text. ```php $FoundPHP_image->image('foundphp.jpg'); //Set color blocks $FoundPHP_image->block( array( 'color' => '#00a9f5', //colour 'x' => 20, //coordinate 'y' => 180, //coordinate 'width' => 100, //width 'height' => 100, //height ) ); //standard zoom $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'cut' =>1, //1 cut the picture, 0 don't cut the picture 'zoom' =>1, //Scaling )); $FoundPHP_image->save('foundphp_new'); ``` achieve effect: ![](data/files/edit/20/05/08/200508_15393867.jpg)
###Add Multi-color Blocks ------------ The position of the color block is in the lower layer of the text and can be used as the background color of the text. ```php $FoundPHP_image->image('foundphp.jpg'); //set color blocks $FoundPHP_image->block( array( 'color' => '#00a9f5', //colour 'x' => 30, //coordinate 'y' => 50, //coordinate 'width' => 100, //width 'height' => 100, //height ) ); //set color blocks $FoundPHP_image->block( array( 'color' => '#dedede', //colour 'x' => 40, //coordinate 'y' => 60, //coordinate 'width' => 100, //width 'height' => 100, //height ) ); //set color blocks $FoundPHP_image->block( array( 'color' => '#800000', //colour 'x' => 50, //coordinate 'y' => 70, //coordinate 'width' => 100, //width 'height' => 100, //height ) ); //standard zoom $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'cut' =>1, //1 cut the picture, 0 don't cut the picture 'zoom' =>1, //scaling )); $FoundPHP_image->save('foundphp_new'); ``` achieve effect: ![](data/files/edit/20/05/08/200508_15469026.jpg)