PHP transparent watermark generation code. Copy the code as follows :? Php ** Createdon2010-10-27 * BYQQ542900563 * CopyrightsReserved2000-2020 * This example shows how to generate the image watermark * load two pictures respectively
The code is as follows:
/*
* Created on 2010-10-27
* BY QQ542900563
* Copyrights Reserved 2000-2020
* This example shows how to generate an image watermark.
*/
// Load two images respectively
$ Im = imagecreatefromjpeg ("liu.jpg ");
$ Img2 = imagecreatefrompng ("m.png ");
// Obtain their respective lengths and widths and calculate their positions
$ Im_WH = getimagesize ("liu.jpg ");
$ Im_W = $ im_WH [0];
$ Im_H = $ im_WH [1];
$ Img2_WH = getimagesize ("m.png ");
$ Img2_W = $ img2_WH [0];
$ Img2_H = $ img2_WH [1];
// Define the storage location
$ NewX = $ im_W-$ img2_W;
$ NewY = $ im_H-$ img2_H;
// Fill
Imagecopy ($ im, $ img2, $ NewX, $ NewY, 0, $ img2_W, $ img2_H );
Header ("Content-type: image/jpeg ");
Imagejpeg ($ im );
?>
The http://www.bkjia.com/PHPjc/325917.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/325917.htmlTechArticle code is as follows :? Php/** Created on 2010-10-27 * BY QQ542900563 * Copyrights Reserved 2000-2020 * This example demonstrates how to generate an image watermark * // load two images respectively...