CopyCode The Code is as follows: 'text watermark
Function wordwatermark (ImagePath)
Dim image
Set image = server. Createobject ("persits. jpeg") 'creates an object
Image. Open Server. mappath (ImagePath) 'image location
Image. Canvas. Font. Color = & h000000' color, which is set to: Black
Image. Canvas. Font. Family = "" 'set the font
Whether to set image. Canvas. Font. Bold = false' to bold
Image. Canvas. Font. size = 26' font size
Image. Canvas. Font. Quality = 4' text definition
Image. Canvas. Print image. originalwidth/2-170, image. OriginalHeight-30, "watermark text" 'watermark text
Image. Save server. mappath (ImagePath) 'save the file
Set image = nothing
End Function
'Image watermark
Function imagewatermark (ImagePath)
Set image = server. Createobject ("persits. jpeg ")
'Are you sure you want to add the watermark image path?
Photopath = server. mappath (ImagePath)
Image. Open photopath
'Open the watermark image
Set logo = server. Createobject ("persits. jpeg ")
Logopath = server. mappath ("logo.jpg") 'watermark Image
Logo. Open logopath
Logo. width = 121 'watermark image size
Logo. Height = 50
Transition_color = & h0066cc
'Place the watermark in the uploaded Image
Image. drawimage image. Width-150, image. Height-59, logo, 1, transition_color, 90
'Here, you can change the watermark's position (photo. Width-210, photo. Height-40 here I put it in the bottom right corner of the image) and the watermark's transparency.
'Save the image after adding the watermark
Image. Save server. mappath (ImagePath)
Set photo = nothing
End Function