Copy Code code as follows:
' Text watermark
Function Wordwatermark (ImagePath)
Dim Image
Set image= Server.CreateObject ("Persits.jpeg") ' establishes an object
Image.open 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)
Image.open Photopath
' Open watermark Picture
Set Logo = Server.CreateObject ("Persits.jpeg")
Logopath = Server.MapPath ("logo.jpg") ' Watermark picture
Logo.open 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