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