Php image and Chinese watermark implementation code sharing Example 1
The code is as follows:
Header ("Content-type: image/png");/* notify the browser to output the image */
$ Im = imagecreate (400,300);/* define the image size */
$ Gray =
This article is a detailed analysis of php verification code (tilt, sine interference line, pasting, rotating). If you need a friend, I haven't written a post for a long time. I have been busy with new projects. Recently, I have been trying to
Php: How to upload multiple images and add watermarks. Next, I will introduce them in detail. if you are interested, refer to the following link. I hope it will help you learn php.
The code is as follows:
Function imageWaterMark ($ groundImage,
Php code for adding a Chinese watermark to an image
Header ("Content-type: image/png");/* notify the browser to output the image */
$ Im = imagecreate (400,300);/* define the image size */
$ Gray =
How to write a nice PHP verification code? Brother even PHP training Small series to share a piece of code to everyone: Class imagecode{ Private $width; Private $height; Private $counts; Private $distrubcode; Private $fonturl; Private
How to write a nice PHP verification code? Brother Even PHP trainingSmall series to share a piece of code to everyone:Class imagecode{Private $width;Private $height;Private $counts;Private $distrubcode;Private $fonturl;Private $session;function
PHP generated graphics verification code needs to use the PHP GD library and the session to the instance, so the GD library generated images to the user to see, and then by the user input validation submitted to the server and the session stored
Verification code question session_start ();
// Number of random codes
$ _ Rnd_code = 4;
// Create a random code
For ($ I = 0; $ I $ _ Nmsg. = dechex (mt_rand (0, 15 ));
}
// Save it in the session
$ _ SESSION ['code'] =$ _ nmsg;
// Set the
/*
* 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;
* $waterpos watermark
Add watermark to the picture is a common and very useful function of PHP program, let me give you a detailed introduction to the PHP PNG transparent background Watermark program code bar.
The code is as follows
Copy Code
Copy CodeThe code is as follows:
/*
* 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;
* $waterPos
Http://www.xxx.tld/?user=K5idDC
Http://www.xxx.tld/?user=2RK4dm
Http://www.xxx.tld/?user=3wemcF
Http://www.xxx.tld/?user=492mF3 ...
For example, the values of the user parameter above point to the same username (ABCD) of the data page, there is a
The UEditor does not have the image watermarking function and requires secondary development. In this example, the Baidu editor is developed twice in the PHPCMS system to add the image watermarking function.First, open the php folder in the UEditor
CopyCode The Code is as follows: /*
* Function: PhP image watermark (watermarks support images or text)
* Parameters:
* $ Groundimage: Specifies the background image to be watermark. Currently, only GIF, JPG, and PNG formats are supported;
* $
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.