首页
开发手册
应用中心
工具
用户中心
FoundPHP 照片:水印
English
中文简体
English
上一篇
下一篇
#FoundPHP Photo: Watermark `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 | center | right | | ------------ | ------------ | ------------ | | tl(upper left corner) |
top(top)
| tr(upper right corner) | | left(left) |
center(Center)
| right(right) | | bl(bottom left) |
bottom(bottom)
| br(bottom right corner) |
**legend:** ![](data/files/edit/20/05/03/200503_00152031.jpg) ###Cut Image Watermark Centered and aWtermarked ```php $FoundPHP_image->image('foundphp.jpg'); //set image watermark $FoundPHP_image->mark( array( 'img' =>'FoundPHP_mini.png', //wtermark photos 'xy' =>'center', //center display 'x' =>10, //move 10 pixels to the left 'y' =>10, //move 10 pixels to the right ) ); $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'cut' =>1, //1 cut the picture, 0 don't cut the picture 'zoom' =>0, )); $FoundPHP_image->save('foundphp_new'); ``` achieve effect: ![](data/files/edit/20/05/05/200505_16586561.jpg)
###Rotate the Watermark Image in the Upper Left Corner of the Cut Image Rotating a special angle will cause part of the photo to be lost ```php $FoundPHP_image->image('foundphp.jpg'); //set image watermark $FoundPHP_image->mark( array( 'img' =>'FoundPHP_mini.png', //watermark photos 'xy' =>'tl', //center display 'angle' => 90, //the angle value rotates counterclockwise 'x' =>10, //move 10 pixels to the left 'y' =>10, //move 10 pixels to the right ) ); $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'cut' =>1, //1 cut the picture, 0 don't cut the picture 'zoom' =>0, )); $FoundPHP_image->save('foundphp_new'); ``` Achieve effect: ![](data/files/edit/20/05/05/200505_17008087.jpg)
###Watermark for Adjusting Transparency of Complementary Color jpg Photos In order to make you see more clearly, we use a red background to set the watermark transparent 60% ```php $FoundPHP_image->image('foundphp.jpg'); //set image watermark $FoundPHP_image->mark( array( 'img' =>'FoundPHP_icon.jpg', //watermark photos 'xy' =>'br', //center display 'alpha' => 60, //transparency ) ); $FoundPHP_image->resize(array( 'width' =>400, 'height' =>400, 'cut' =>0, //1 cut the picture, 0 don't cut the picture 'zoom' =>1, 'bgcolor' =>'#800000', //png and gif transparency settings are invalid )); $FoundPHP_image->save('foundphp_new'); ``` achieve effect: ![](data/files/edit/20/05/05/200505_17171820.jpg)