aspjpeg组件通用加水印函数代码
程序员文章站
2022-06-05 12:37:21
aspjpeg组件实现加水印函数的调用方法: <%printwater "/images/水印图片.gif","/uploadfile/上传图片.jpg") %>...
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
<%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