Home > Backend Development > PHP Tutorial > 让php处理图片变得简单 基于gb库的图片处理类附实例代码下载_PHP

让php处理图片变得简单 基于gb库的图片处理类附实例代码下载_PHP

WBOY
Release: 2016-06-01 12:16:49
Original
757 people have browsed it

这个类的设计思想借鉴于jQuery,通过连缀方法来操作图片,如:
复制代码 代码如下:
$image = new UsaImage(array('filepath'=>'image1.jpg'));
//图片图片覆盖一张图片,第二和第三参数为,要放置的x,y位置
$image->Overlap("image99.gif", 10, 10)
//以相对位置来覆盖图片,最后一个参数为缩放比例,默认为1
->Overlap2('image00.gif',array('right'=>23,'bottom'=>50),0.5)
//缩放图片,设置最大宽和最大高,图片会等比例缩放
->Scale3(300,300)
//输出到屏幕,自动会加上图片头部,类型为jpg,IMAGETYPE_JPEG 为php的gb库的常量
->Write(IMAGETYPE_JPEG);

效果:

 

更多方法,请查看代码备注

代码下载: usaimage.rar

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template