The design idea of this class draws on jQuery and uses the concatenation method to operate images, such:
Copy codeThe Code is as follows: $ image = new UsaImage (array ('filepath' => 'image1.jpg '));
// The image overwrites an image. Parameters 2 and 3 are the x and y positions to be placed.
$ Image-> Overlap ("image99.gif", 10, 10)
// Overwrite the image at a relative position. The last parameter is the scaling ratio. The default value is 1.
-> Overlap2('image00.gif ', array ('right' => 23, 'bottom' => 50), 0.5)
// Scale the image, set the maximum width and height, and scale the image proportionally.
-> Scale3 (1, 300,300)
// Output to the screen. The program header is automatically added, and the type is jpg. IMAGETYPE_JPEG is the constant of the php gb library.
-> Write (IMAGETYPE_JPEG );
Effect:
For more methods, see the code remarks.
Download the code: usaimage.rar