- /*
- * Created on 2010-10-27
- * BY QQ542900563
- * Copyrights Reserved 2000-2020
- * This example demonstrates how to generate image watermarks
- */
- //Load separately Two pictures
- $im=imagecreatefromjpeg("liu.jpg");
- $img2=imagecreatefrompng("m.png");
-
- //Get their respective length and width, calculate the position
- $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,0,$img2_W,$img2_H);
-
- header("Content-type:image/jpeg");
- imagejpeg($im);
-
- ?>
Copy code
|