The design idea of this class is borrowed from jQuery, and images are manipulated through concatenation methods, such as:
Copy code The code is as follows:
$image = new UsaImage(array('filepath'=>'image1.jpg'));
//The picture covers a picture, the second and third parameters are the x and y positions to be placed
$image->Overlap("image99.gif", 10, 10)
//Overlay the image with relative position, the last parameter is the scaling ratio, the default is 1
->Overlap2(' image00.gif',array('right'=>23,'bottom'=>50),0.5)
//Scale the image, set the maximum width and maximum height, the image will be scaled in equal proportions
- >Scale3(300,300)
//Output to the screen, the image header will be automatically added, the type is jpg, IMAGETYPE_JPEG is a constant of the gb library of php
->Write(IMAGETYPE_JPEG);
Effect:
For more methods, please check the code notes
Code download: usaimage.rar
http://www.bkjia.com/PHPjc/323332.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323332.htmlTechArticleThe design idea of this class is borrowed from jQuery, and the image is manipulated through the concatenation method, such as: Copy the code as follows: $ image = new UsaImage(array('filepath'='image1.jpg')); //Image overlay...