Write Chinese or watermarks to images

Source: Internet
Author: User
Write Chinese or watermarks to images
It's actually a watermark.

  1. // Session_start ();
  2. Header ("Content-type: image/png"); // declare an image
  3. // $ Image = imagecreate (417,294); // create an image size
  4. $ Image = imagecreatefrompng ("cj.png ");
  5. $ Admin = imageCreatefrompng ("admin.png ");
  6. $ Wfilew = imagesx ($ image); // Obtain the image width.
  7. $ Wfileh = imagesy ($ image); // Obtain the image height.
  8. $ Waterw = imagesx ($ admin); // Obtain the watermark image width.
  9. $ Waterh = imagesy ($ admin); // Obtain the watermark image height.
  10. // $ Imgbg = imagecolorallocate ($ image, 30, 30, 30); // The background color of the image.
  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", "Lu Yun ");
  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 ['lvta'] = $ waterstring;
  21. Imagepng ($ image );
  22. ?>
  23. // $ Email = 'User @ lvtao.net ';
  24. // $ Domain = strstr ($ email ,'@');
  25. // Echo $ domain; // prints @ lvtao.net'
  26. ?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.