The parameter passed in is the image path that needs to be processed. You can adjust the parameters or add other parameters as needed . Copy the code as follows:
'Text watermark
Function WordWatermark(ImagePath)
Dim Image
Set Image= Server.CreateObject(Persits.Jpeg) 'Create object
Image.Open server.mappath(ImagePath) 'The location of the image
Image.Canvas.Font.Color = &H000000 'Color, here it is set to: black
Image.Canvas.Font.Family = 宋体' Set the font
Image.Canvas.Font.Bold = False 'Whether to set it 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
'Picture watermark
Function ImageWatermark(ImagePath)
Set Image = Server.CreateObject(Persits.Jpeg)
'Determine the path of the image to be added to the watermark
PhotoPath = Server.MapPath(ImagePath)
Image.Open PhotoPath
'Open the watermark image
Set Logo = Server.CreateObject(Persits.Jpeg)
LogoPath = Server.MapPath(logo.jpg) 'Watermark picture
Logo.Open LogoPath
Logo.Width = 121 'The size of the watermark image
Logo.Height = 50
Transition_Color = &h0066cc
'Place watermark in uploaded 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 placed it in the lower right corner of the picture) and you can also change the transparency of the watermark
'Save the image after adding watermark
Image.Save Server.MapPath(ImagePath)
Set Photo = Nothing
End Function