La clé du succès ici est la suivante : l’image du filigrane doit être au format png, et l’effet sera le même lorsque l’arrière-plan est supprimé. Fonction de mise en œuvre des opérations :
Copiez le code comme suit :
Fonction AddWater(n)
Définir Photo = Server.CreateObject (Persits.Jpeg)
PhotoPath = Serveur.MapPath(n)
Photo.Ouvrir PhotoPath
Photo.Interpolation=1
Photo.Qualité=100
iWidth=Photo.OriginalWidth
iHauteur=Photo.OriginalHeight
iiwidth=214 'Largeur de l'image en filigrane
iiheight=51 'Hauteur de l'image en filigrane
Photo.Canvas.DrawPNG iWidth-iiWidth-5, iHeight-iiHeight-5,Server.MapPath(Water.png) 'Water.png est l'image du filigrane
Photo.save Server.mappath(n) 'Images de sortie
Définir la photo = Rien
Fonction de fin
Méthode d'appel :
<% Appeler AddWater(nom de l'image)%>