ASP Image Watermark Function Code _ Application Skills

Source: Internet
Author: User
Tags save file
Copy Code code as follows:

' Text watermark
Function Wordwatermark (ImagePath)
Dim Image
Set image= Server.CreateObject ("Persits.jpeg") ' establishes an object Server.MapPath (ImagePath) ' Image location
Image.Canvas.Font.Color = &h000000 ' color, here is set to: Black
Image.Canvas.Font.Family = "XXFarEastFont-Arial" set font
Image.Canvas.Font.Bold = False ' is set to bold
Image.Canvas.Font.Size = 26 ' font size
Image.Canvas.Font.Quality = 4 ' Text clarity
Image.Canvas.Print image.originalwidth/2-170,image.originalheight-30, "watermark text" ' Watermark text
Image.Save Server.MapPath (ImagePath) ' Save file
Set image= Nothing
End Function

' Image watermark
Function Imagewatermark (ImagePath)
Set Image = Server.CreateObject ("Persits.jpeg")
' Determine the path of the picture to be added to the watermark
Photopath = Server.MapPath (ImagePath) Photopath
' Open watermark Picture
Set Logo = Server.CreateObject ("Persits.jpeg")
Logopath = Server.MapPath ("logo.jpg") ' Watermark picture Logopath
Logo.width = 121 ' Size of watermark picture
Logo.height = 50
Transition_color = &h0066cc
' Place the watermark in the upload image
Image.drawimage image.width-150, image.height-59, logo,1,transition_color,90
' Here you can change the location of the watermark (photo.width-210,photo.height-40 here I put it in the lower-right corner of the picture) you can also change the transparency of the watermark
' Save the picture after adding the watermark
Image.Save Server.MapPath (ImagePath)

Set Photo = Nothing
End Function
Related Article

Contact Us

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: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.