Added the Image Upload watermark function (php Code) to the Kindeditor editor ),
KindEditor is an open-source online HTML editor. developers can use KindEditor to replace the traditional multi-line text input box (textarea) with a visualized rich text input box. It can be seamlessly integrated with Java,. NET, PHP, ASP and other programs, and is suitable for use in Internet applications such as CMS, mall, f
The method used here is to add a watermark During User Access (without damaging the original image, but affecting server performance ).
(1) Use the general processing program bookcover. asxh
Using system;Using system. Web;Using system. drawing;Using system. IO;
Public class bookcover: ihttphandler {// Cover folder pathPrivate const string coversaddr = "~ /Images/bookcovers /";// Digital
' Text watermark
function Wordwatermark (ImagePath)Dim imageSet image= Server.CreateObject ("Persits.jpeg") ' establishes an objectImage.open Server.MapPath (ImagePath) ' Image locationImage.canvas.font.color = h000000 ' color, here is set to: Blackimage.canvas.font.family = "XXFarEastFont-Arial" set fontImage.canvas.font.bold = False ' is set to boldImage.ca
. " Still small, unable to generate watermark! ";
Return
}
Switch ($waterPos)
{
Case 0://Random
$posX = rand (0, ($ground _w-$w));
$posY = rand (0, ($ground _h-$h));
Break
Case 1://1 for top left
$posX = 0;
$posY = 0;
Break
Case 2://2 for top center
$posX = ($ground _w-$w)/2;
$posY = 0;
Break
Case 3://3 for top right
$posX = $ground _w-$w;
$posY = 0;
Break
Case 4://4 for Central left
$posX = 0;
$posY = ($ground _h-$h)/2;
Break
Php image watermark function code (supports pictures and text)
/*
* Function: php image watermark (watermarks support images or text)
* Parameters:
* $ GroundImage: specifies the background image to be
Using PHP to upload the image watermark program is to determine the file type to build graphics, and then copy it to the original set up the graphics, fill and build rectangle, in order to write imagestring () or the original has been fixed image program to determine the watermark type: One is a string, Another is to a
Copy Code code as follows:
involving namespaces
Using System;
Using System.Collections;
Using System.ComponentModel;
Using System.Data;
Using System.Data.SqlClient;
Using System.Drawing;
Using System.Drawing.Drawing2D;
Using System.Drawing.Imaging;
Using System.Web;
Using System.Configuration;
Method
public void AddUser (string personname, String personemail, String personsex, String Persondob, String personimage, String Personimagetype)
{
string strimagetype = UserImage.Pos
/*
* 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
This article is mainly for everyone in detail introduced the Kindeditor editor plus image upload watermark function, with a certain reference value, interested in small partners can refer to, hope to help everyone.
Kindeditor is an open source online HTML editor that allows developers to replace traditional multi-line text input boxes (textarea) with visual rich text input boxes with Kindeditor. Can be se
Open the Upload class file in the PHP directory under Ueditor compression package: Uploader.class.phpAdd the call watermark processing method under the main method of uploading files:
The code is as follows
Copy Code
/*** The main processing method of uploading files* @return Mixed*/Private Function Upfile (){................................................$this->stateinfo = $this->statemap[0]; (about 122 lines)Add below t
ObjectiveJava development often encountered in the processing of images, JDK also provides the corresponding tool classes, but it is cumbersome to deal with, Thumbnailator is a good image processing of open-source Java class Library, processing effect is far better than the Java API, The process is simplified from the classes in which the API provides existing image files and
Add a watermark (canvas + drag) to the image in the blog garden ),Preface I want to add a watermark to some of my pictures, so I am playing with such a thing.This function does not take compatibility into consideration (too lazy). It is only tested in Chrome. If you do not pass the test in IE Firefox, do not vomit.Because the download attribute is applied, you do
Image watermark in PHP There are many ways to achieve, he these features are based on the GD library in PHP, if there is no opening of the GD library is not allowed to use the watermark function.
The Imagecopymerge () function is used to copy and merge part of the image, which returns TRUE successfully, otherwise FALSE
Add watermarks to PHPimagecopy () and imagecopymerge () images. There are many ways to add watermarks to images in php. these functions are based on the GD Library in php. if you do not have an account, you cannot use the watermark function. There are many ways to add watermarks to imagecopymerge images in php. these functions are based on the GD Library in php. if you do not open a GD library, you cannot use the
This article summarizes two php functions that can be used to add watermarks to images. The first one is easier to understand and the second one is more powerful and encapsulated, if you have any need, you can refer to php to add a watermark to an image.
Let's take a look at adding watermarks to images and text. Images can be in GIF, PNG, or JPG formats. Watermarks can be in PNG or GIF formats.
Functio
This article summarizes two php functions that can be used to add watermarks to images. The first one is easier to understand and the second one is more powerful and encapsulated, if you have any need, you can refer to php to add a watermark to an image.
Let's take a look at adding watermarks to images and text. Images can be in GIF, PNG, or JPG formats. watermarks can be in PNG or GIF formats.
Functio
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.