CopyCode The Code is as follows: using system;
Using system. Collections. Generic;
Using system. text;
Using system. drawing;
Using system. IO;
Using system. Drawing. imaging;
Using system. Web;
Using system. Drawing. drawing2d;
Using system. reflection;
Namespace Chen
{
Public class warterpic
{
/// /// Add a watermark to the image
/// /// /// ///
Public void markwater (string filepath, string waterfile)
{
Add watermark information to the image in Asp.net
Using System. Drawing; using System. IO; using System. Drawing. Imaging; private void AddTextToImg (string fileName, string text) {if (! File. Exists (MapPath (fileName) {throw new FileNotFoundException ("The file don't exist! ");} If (text = string. empty) {return;} // you need to determine whether the file type is of the image type. I will not go into deta
You need to use the iconv encoding conversion function to transcode Chinese. you need to use the iconv encoding conversion function to transcode Chinese.
Header ("Content-type: image/png");/* notify the browser to output the image */$ Im = imagecreate (400,300);/* define the image size */$ Gray = ImageColorAllocate ($ im, 235,235,235 );$ Pink = ImageColorAllocate ($ im, 255,128,255 );$ Fontfile = "simkai. ttf ";/* $ Fontfile font path, depending on the operating system, can be simh
Add a text php watermark to your image at any time
Header ("Content-type: image/jpeg ");
Function makethumb ($ srcFile, $ text, $ size = 12, $ R = 0, $ G = 0, $ B = 0 ){
If (! $ Text ){
$ Text = 'Welcome xs.net.ru xayle ';
$ Size = 20;
$ R = 255;
}
$ Data = GetImageSize ($ srcFile, $ info );
Switch ($ data [2]) {
Case 1: // image type. 1 is a GIF image.
$ Im = @ ImageCreateFromGIF ($ srcFile );
Break;
Cas
This article illustrates the use of PHP imagick cut, generate thumbnails, add watermark automatic detection and processing, support GIF, share for everyone to reference, the specific content as follows
Call Mode:
Include ' imagick.class.php ';
$image = new Lib_image_imagick ();
$image->open (' a.gif ');
$image->resize_to ("Scale_fill");
$image->add_text (' 1024i.com ');
$image->add_waterm
Please click the beginning of the article link, to download
--------------------------------------------------------------------------------
Add a watermark to a picture
Copy Code code as follows:
$source =imagecreatefromjpeg (' e:/image/guide_pic.jpg ');
$thumb =imagecreatefromjpeg (' e:/image/l.jpg ');
Get the width, height, type of the picture
List ($width, $height, $mine) =getimag
C # is shared by the example in this article. NET add image watermark method, for everyone's reference, the specific contents are as follows
Using System;
Using System.Drawing;
Using System.Drawing.Drawing2D;
Using System.Drawing.Imaging;
Using System.IO; namespace Pub.class {///
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud ha
This article realizes the function specially applies in some mall and the picture station, shares the picture to add the text and the picture watermark technique in the upload, for everybody reference, the concrete content is as follows
1. water.class.php
2. test1.php
3. Effect drawing
The above is the entire content of this article, I hope that you learn PHP programming help.
This article mainly introduces the use of PHP code to add watermark to the image of the relevant information, the need for friends can refer to the
First find a picture, renamed to Face.jpeg, create watermark.php:
?
1 2 3 4 5 6 7 8 9 10 11-12
The effect is as follows:
The above mentioned is the entire content of this article, I hope you can enjoy.
This article mainly introduces the ASP.net how to add watermark text to the picture to achieve, the need for friends can refer to the The first step is to add a generic handler (Handler), in this case ImageHandler nbsp; code as follows: using System; Using System.Data; Using System.Configuration; Using System.Web; Using System.Web.Security; Using System.Web.UI;
This article mainly introduces the PHP use of the GD library for the page to add watermark to the specific implementation, the need for friends can refer to the following nbsp; Code as follows: ;nbsp; nbsp;
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.