AspJpeg is a persits-produced shareware, the probationary period is 30 days, you can download here: Http://www.persits.com/aspjpeg.exe.
The latest version number is 1.3.
=========================================
<%
Sub Jpegclass (imgurl,fontsize,family,isbold,top,left,content,horflip) ' Invoke procedure name
Dim Jpeg,font_color,font_size,font_family,f_width,f_height,f_content,f_horflip
' Establish an instance
Set Jpeg = Server.CreateObject ("Persits.jpeg")
font_size=10
Font_family= "Song Body"
F_left= 5
F_top=5
If imgurl<> "" Then
Jpeg.open Server.MapPath (imgurl) ' Picture path and open it
Else
Response.Write "Picture Path not Found"
Exit Sub
End If
If fontsize<> "then font_size=fontsize" Font size
If family<> "then font_family=family" font
If top<> "" then f_left=left Watermark to the left of the picture
If left<> "" then F_top=top "watermark from top position of picture
If content= "then" watermark content
Response.Write "Watermark What content, Watermark is unsuccessful!" "
Exit Sub
Else
F_content=content
End If
' Add text watermark
Jpeg.Canvas.Font.Color = &hff0000 ' Red
Jpeg.Canvas.Font.Family = font_family
Jpeg.canvas.font.size= font_size
If Isbold=1 Then
Jpeg.Canvas.Font.Bold = True
End If
If Horflip = 1 Then
Jpeg.fliph
' Jpeg.sendbinary
End If
Jpeg.Canvas.Print F_left, F_top, f_content
' Save file
Jpeg.save Server.MapPath (Imgurl)
' Logout Object
Set Jpeg = Nothing
Response.Write "Watermark was successful, the picture added" &content& "
End Sub
Call Jpegclass ("Apple.jpg", 13, "italics", 1,18,18, "Hello, this is a watermark program", 1)
%>
Download AspJpeg build first, use after registration
############### #转载方法2 ####################
ASP to add watermark to the image is the need for components ... Commonly used with AspJpeg software and the Chinese developed their own wsimage software, you can search the Internet to download these two software, recommended the use of our own development of the Chinese wsimage, after all, is the Chinese version, easy to operate.
How to register a component:
At the command prompt, enter "regsvr32 [DLL path]".
Image add watermark is simply to get the picture size, and then write the watermark up. The ASP code is just a control component. Use code to explain everything.
One: Get the picture size (here is the pixel value). All the friends who are learning Photoshop should understand.
<%
Set Obj=server. CreateObject ("Wsimage.resize") ' Invoke component
Obj. Loadsoucepic Server.MapPath ("25.jpg") ' Open the picture, the picture name is 25.jpg
In fact, add a watermark to the picture is so simple. And then I'm going to say another two main usages of the WsImage.dll component. Includes:
Trim the picture and generate a thumbnail of the picture.
Or in my habit, use code to add notes:
To trim a picture:
<%
Set Obj=server. CreateObject ("Wsimage.resize")
Obj. Loadsoucepic Server.MapPath ("25.jpg")
Obj. Quality=75
Obj.cropimage Server.MapPath ("25_crop.jpg"), 100,10,200,200 ' define cut size and generate picture name
Strerror=obj.errorinfo
If strerror<> "" Then
Response.Write Obj.errorinfo
End If
Obj.free
Set obj=nothing
%>
Detailed note: Cut the picture to use the Wsimage Cropimage method. When the definition generates the picture, 100,10 is the cut point in the upper left corner, which is 100 pixels to the left of the picture, and the top 10 pixels. The latter two 200 represent the cut of the broadband and high and height.
The first 0.5 indicates that the resulting thumbnail is half the width of the original image, which means a narrowing ratio.
The second 0.5 means that the resulting thumbnail is half the height of the original image, which means a high narrowing ratio.
A wide-height narrowing of the proportions means that the original image will be scaled down. If the zoom ratio is greater than 1, the original image is magnified.
I hope this technical article will help you.
Applet details and download address: http://www.mbsky.com/SoftView/SoftView_38956.html
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.