The key to success here is: the watermark image must be in png format, and the effect will be the same when the background is removed. Operation implementation function:
Copy the code code as follows:
Function AddWater(n)
Set Photo = Server.CreateObject(Persits.Jpeg)
PhotoPath = Server.MapPath(n)
Photo.Open PhotoPath
Photo.Interpolation=1
Photo.Quality=100
iWidth=Photo.OriginalWidth
iHeight=Photo.OriginalHeight
iiwidth=214 'Width of watermark image
iiheight=51 'Height of watermark image
Photo.Canvas.DrawPNG iWidth-iiWidth-5, iHeight-iiHeight-5,Server.MapPath(Water.png) 'Water.png is the watermark image
Photo.save Server.mappath(n) 'Output pictures
Set Photo = Nothing
End Function
Calling method:
<% Call AddWater(picture name)%>