aspjpeg组件通用加水印函数代码

时间:2022-06-01 19:20:23

aspjpeg组件实现加水印函数的调用方法: 
<%printwater "/images/水印图片.gif","/uploadfile/上传图片.jpg") %> 

复制代码代码如下:


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 '//增加水印后图片的边框色彩。 
ogvbox.Canvas.Pen.Width = 1 '//增加水印后图片的边框宽度。 
ogvbox.Canvas.Brush.Solid = False '//边框内是否填充颜色,你可以试试看值为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