Home > Backend Development > PHP Tutorial > Write Chinese or watermark on the picture

Write Chinese or watermark on the picture

WBOY
Release: 2016-07-25 09:09:03
Original
1171 people have browsed it
It's actually a watermark
  1. //session_start();
  2. header("Content-type: image/png"); //Declare image
  3. //$image = imagecreate(417, 294); //Create image Size
  4. $image = imagecreatefrompng("cj.png");
  5. $admin = imageCreatefrompng("admin.png");
  6. $wfilew=imagesx($image);//Get the width of the image
  7. $wfileh=imagesy( $image);//Get the height of the image
  8. $waterw=imagesx($admin);//Get the width of the watermark image
  9. $waterh=imagesy($admin);//Get the height of the watermark image
  10. //$imgbg = imagecolorallocate($image,30, 30, 30); //Picture background color
  11. //imagefill($image, 10, 10, $imgbg);
  12. $colorBlack = imagecolorallocate($image, 0, 0, 0);
  13. $colorBlacks = imagecolorallocate($image, 144, 144, 144);
  14. imagettftext($image, 20, 0,270, 250, $colorBlack, "simkai.ttf", "LV Tao");
  15. imagettftext($image , 12, 0,230, 424, $colorBlacks, "arial.ttf", "420528198602344812");
  16. imagettftext($image, 12, 0,290, 450, $colorBlacks, "arial.ttf", "PHP100-20100001");
  17. imagettftext($image, 12, 0,260, 477, $colorBlacks, "arial.ttf", "PHP100-20100001");
  18. imagecopy($image, $admin, 550, 350, 0, 0, $waterw,$waterh) ;
  19. //imagestring("2.jpg",2,3,10,$waterstring,$colorBlack);
  20. //$_SESSION['lvtao']=$waterstring;
  21. imagepng($image);
  22. ?>
  23. //$email = 'user@lvtao.net';
  24. //$domain = strstr($email, '@');
  25. / /echo $domain; // prints @lvtao.net'
  26. ?>
Copy code


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template