If you need to add watermark to pictures under ASP, you generally need some components. ASPJPEG is one of the most commonly used components in ASP. The following method is used. The aspjpeg component implements the calling method of the watermarking function:
<%printwater /images/watermark picture.gif,/uploadfile/upload picture.jpg) %>
Copy the code code as follows:
function printwater(waterpath,upfilepath)
Dim Logobox,LogoPath,ogvbox
LogoPath = Server.MapPath(waterpath)
Set Logobox = Server.CreateObject(Persits.Jpeg)
Logobox.Open LogoPath
Logobox.Width = 108
Logobox.Height = 65
Set ogvbox = Server.CreateObject(Persits.Jpeg)
ogvbox.Open Trim(Server.MapPath(upfilepath))
ogvbox.Canvas.Pen.Color = &H000000 '//Add watermark to the border color of the picture.
ogvbox.Canvas.Pen.Width = 1 '//Increase the border width of the image after watermarking.
ogvbox.Canvas.Brush.Solid = False '//Whether the border is filled with color, you can try it to see the effect when the value is True^o^
ogvbox.DrawImage ogvbox.width-108, ogvbox.height-65, Logobox, 0.6
ogvbox.Canvas.Bar 0, 0, ogvbox.Width, ogvbox.Height
ogvbox.Save Server.MapPath(upfilepath)
Set Logobox=Nothing
Set ogvbox=Nothing
end function