水印测试(重新测试)
程序员文章站
2022-05-18 12:53:10
注:如果你是用fireworks来处理logo图片,在导出图片的时候用alpha透明而不要用索引透明!
dim jpeg,logoset jpeg&n...
注:如果你是用fireworks来处理logo图片,在导出图片的时候用alpha透明而不要用索引透明!
dim jpeg,logo
set jpeg = server.createobject("persits.jpeg")
jpeg.open server.mappath(uploaddir&request2.form("localimage"))'打开图片
'添加文字水印
'jpeg.canvas.font.color = &hff0000' 红色
'jpeg.canvas.font.family = "verdana"
'jpeg.canvas.font.size = 15
'jpeg.canvas.font.shadowcolor = &hcccccc '水印文字的阴影色彩。
'jpeg.canvas.font.shadowxoffset = 2 '阴影右偏移,负值则左偏移。
'jpeg.canvas.font.shadowyoffset = 2 '阴影下偏移,负值则右偏移。
'jpeg.canvas.font.quality = 1 '水印文字清晰度,从0~4
'jpeg.canvas.font.shadowcolor = &h999999
'jpeg.canvas.pen.width = 1
'jpeg.canvas.brush.solid = true
'jpeg.canvas.font.bold = true
'jpeg.canvas.print jpeg.width-171, jpeg.height-38, "blog.goalercn.com"
'jpeg.canvas.print jpeg.width-201, jpeg.height-20, "copyright (c) goaler's blog"
'添加水印图片
set logo = server.createobject("persits.jpeg")
logo.open server.mappath("canvaslogo.gif")
if(jpeg.width-8>logo.width and jpeg.height-8>logo.height)then
logo.sharpen 0.7,120
jpeg.drawimage jpeg.width-logo.width-8,jpeg.height-logo.height-8,logo,1,&hffffff'抽取掉白色背景,水印位于右下角
jpeg.save server.mappath(uploaddir&request2.form("localimage"))'保存文件
end if
set logo = nothing'注销对象
set jpeg = nothing'注销对象
set jpeg = server.createobject("persits.jpeg")
jpeg.open server.mappath(uploaddir&request2.form("localimage"))'打开图片
'添加文字水印
'jpeg.canvas.font.color = &hff0000' 红色
'jpeg.canvas.font.family = "verdana"
'jpeg.canvas.font.size = 15
'jpeg.canvas.font.shadowcolor = &hcccccc '水印文字的阴影色彩。
'jpeg.canvas.font.shadowxoffset = 2 '阴影右偏移,负值则左偏移。
'jpeg.canvas.font.shadowyoffset = 2 '阴影下偏移,负值则右偏移。
'jpeg.canvas.font.quality = 1 '水印文字清晰度,从0~4
'jpeg.canvas.font.shadowcolor = &h999999
'jpeg.canvas.pen.width = 1
'jpeg.canvas.brush.solid = true
'jpeg.canvas.font.bold = true
'jpeg.canvas.print jpeg.width-171, jpeg.height-38, "blog.goalercn.com"
'jpeg.canvas.print jpeg.width-201, jpeg.height-20, "copyright (c) goaler's blog"
'添加水印图片
set logo = server.createobject("persits.jpeg")
logo.open server.mappath("canvaslogo.gif")
if(jpeg.width-8>logo.width and jpeg.height-8>logo.height)then
logo.sharpen 0.7,120
jpeg.drawimage jpeg.width-logo.width-8,jpeg.height-logo.height-8,logo,1,&hffffff'抽取掉白色背景,水印位于右下角
jpeg.save server.mappath(uploaddir&request2.form("localimage"))'保存文件
end if
set logo = nothing'注销对象
set jpeg = nothing'注销对象
上一篇: JSP学习之数据库开发小结
下一篇: jsp简单实现页面之间共享信息的方法