Phpgd2 uploads image text watermark, image watermark, and other proportional thumbnail source code. For more information, see.
The code is as follows:
// Upload file type list
$ Uptypes = array (
'Image/jpg ',
'Image/jpeg ',
'
Text watermark
Text watermark is to add text on the picture, mainly using the Imagefttext method of GD library, and need font file. The effect chart is as follows:
The implementation code is as follows:
Copy Code code as follows:
$dst _path = ' dst.jpg ';
Create an instance of a picture$DST = imagecreatefromstring (file_get_contents ($DST _path));
Make a text$font = './SIMSUN.TTC ';//fo
Php image watermark class, php adds Chinese watermark code
Header ("Content-type: image/png");/* notify the browser to output the image */
$ Im = imagecreate (400,300);/* define the image size
PHP for the image plus watermark code, PHP image watermark instance, you can set the upload file size limit, set whether to add watermark, set the watermark location, watermark string a
Header ("Content-type:image/png"); /* Notify browser, to output image */
$im = Imagecreate (400, 300); /* Define the size of the image */
$gray = Imagecolorallocate ($im, 235, 235, 235);
$pink = Imagecolorallocate ($im, 255, 128, 255);
$fontfile = "Simkai.ttf";
/* $fontfile the path to the font, depending on the operating system, can be Simhei.ttf (bold), Simkai. TTF (in i
Image watermark is not only the watermark text can also be a picture, this time to achieve a watermark image watermark picture, after the need to use a code batch processing their own p
Keywords:Enterprise Applications
The customer said today that he wants to add a watermark to the image he uploaded to prevent others from stealing the image. He thinks that his images are very important. So...Well, if the customer has a need, we can satisfy him. I used to write less image operations APIs, so I have nev
PHP plus picture watermark, Text watermark Class code, PHP plus watermark class, support the text image watermark Transparency settings, watermark picture background transparent. Write a class of their own, because the development
/*'-##########################################-|'| Program design: (Green Bamboo Residence) |'| Msn:[email]lzj_zhangjun@hotmail.com[/email] |'| email:cszjun@gmail.com |'| Combine their previous upload and build abbreviations and adapt a'| The old-timers create a picture watermark made this |'| Upload + Generate thumbnails + Generate text watermark and image
1.Thinkphp image ProcessingIn the TP frame, we often use the image upload, I recently wrote a lot about the picture upload article, thinkphp picture upload +validate form verification + picture Trojan detection + thumbnail generation, and so on, today write about the picture after the successful upload to the image watermark
/*
* Function: PHP image watermark (watermark supports picture or text)
Parameters
* $groundimage background image, that is, need to add a watermark image, temporarily only support gif,jpg,png format;
* $waterP
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.