Let php process images easily. For more information, see. The design idea of this class draws on jQuery and uses the concatenation method to operate images, such:
The 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