Picture Add watermark I believe all friends know, today we look at a section of PHP image add watermark example, I hope the article can help friends.
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.
PHP add watermark scale thumbnail fixed height fixed width class.When using the Foreach Loop, sleep is required to set a time or follow the returned value after processing, otherwise the processing is not complete.Download: Http://pan.baidu.com/s/1ntKAfFF
File name: image_process.class.php
Class image_process{
public $source;//Original
Public $source _width;//Wide
P
Has anyone ever used a imageimagick to add a watermark to a picture?
Don't know why
1. On the Linux server is the 3.0.1 version of Imagick that performs the following code-report exception
Fatal error:uncaught exception ' imagickdrawexception ' with message ' unable to composite '
I'm talking about an error while executing the composite function, and it's okay to change the
1. Add watermark function to picture
Dim Jpeg
Set Jpeg = Server.CreateObject ("persits.jpeg") ' establishes object
Jpeg.open Blogpath "/upload/" FileName image location
Jpeg.Canvas.Font.Color = h000000 ' color, here is set to: Black
Jpeg.Canvas.Font.Family = "founder of the Simplified" ' Set font
Jpeg.Canvas.Font.Bold = False ' is set to bold
Jpeg.Canvas.Font.Size = 26 ' font size
Jpeg.Canvas.Font.Quali
Often see someone on the mop of that dynamic picture, is a string as parameters to a Dynamic Web page, you will generate a picture with this string, called a text watermark. Like what the original Panda series, as well as the later trees and gold bars, are very interesting. I wrote a very simple one with asp.net. All the code is as follows:
Copy Code code as follows:
Just save this code as an ASPX file, such as Test.aspx. Then put
the long edge, and generate a small figure
Imgwidth=jpeg.originalwidth
Imgheight=jpeg.originalheight
If Imgwidth>=imgheight and imgwidth>120 then
jpeg.width=150
jpeg.height=jpeg.originalheight/(jpeg.originalwidth/150)
End If
If Imgheight>imgwidth and imgheight>113 then
jpeg.height=113
jpeg.width=jpeg.originalwidth/(jpeg.originalheight/113)
End If
Jpeg.sharpen 1, 130
Jpeg.save (smallfilepath "S_" file.filename)
' Add a
You can use aspose. Cells to add special text effects to a workbook. For example, you can stretch the title, modify the text, make the text conform to the preset shape, or add a watermark effect to the workbook.
The following example shows how to use the Simple API provided by aspose. Cells to add watermarks to a wor
position of the font in the picture * @param $y: The y position of the font in the picture * @param $color: The color of the font is a An array of Rgba * @param $text: What you want to add * manipulate images in memory to add text watermarks to pictures*/ PublicfunctionFontmark ($fontsize,$x,$y,$color,$text){ $col= Imagecolorallocatealpha ($this->image,$color[0],$color[1],$color[2],$color[3]); Image
Let's look at the effect chart first:
The main code is as follows:
Package sea;
Import Net.coobird.thumbnailator.Thumbnails;
Import net.coobird.thumbnailator.geometry.Positions;
Import Javax.imageio.ImageIO;
Import Java.awt.image.BufferedImage;
Import Java.io.File;
Import java.io.IOException;
Import java.util.ArrayList;
Import java.util.List; /** * User:Greta.Wang * date:12-11-3 * Read Nine pictures from file system, and compose them to one, in the process,
Each of the picture would be add
Add a php watermark to your image at any time. Add text to your picture at any time? Header (Content-type: imagejpeg); functionmakethumb ($ srcFile, $ text, $ size12, $ R0, $ G0, $ B0) {if (! $ Text) {$ textwelcomexs.net. ruxayle; $ size add text to your image at any time
Header ("Content-type: image/jpeg ");
Function
format=textformatflags.endellipsis|Textformatflags.verticalcenter; if(RightToLeft = =righttoleft.yes) {format|= Textformatflags.righttoleft |Textformatflags.right; } textrenderer.drawtext (Graphics, _emptytexttip, Font,Base. ClientRectangle, _emptytexttipcolor, format); } } } }}2. Instantiate the control in the form and add:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingS
Asp.net is an example of how to generate a thumbnail and add a watermark to the original image.
This document describes how to use asp.net to generate thumbnails and add watermarks to original images. We will share this with you for your reference. The details are as follows:
Using System. IO; using System. drawing. imaging; private void button#serverclick (objec
This example describes the jquery implementation to add a watermark text effect to the control. Share to everyone for your reference, specific as follows:
The screenshot of the running effect is as follows:
The online demo address is as follows:
http://demo.jb51.net/js/2015/jquery-text-add-txt-style-codes/
The specific code is as follows:
Full
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.